fix matlab script