I don't quite understand what you are trying to do here, but exp(-.5*(xp.^2/sigma^2)+(gamma^2*yp.^2)/sigma^2) produces 6 values, sa=tarting with 1.4852 0.5315 0.5315 1.4852 4.1501 4.1501. Is that what you want? Also , onm the .m file the instruction reads as ...