Hi, I read that vectorizing your matlab program will speed it up so I am trying to vectorize the following for loop:
mysum = 0; for kx = -1:dk:1 kyMax = sqrt(1^2-kx^2); for ky = 0:dk:kyMax myeps = kx^2 + ky^2; mysum = mysum + myeps; end end
I'm not sure how to do it since {kx,ky} is not a rectangular array but rather one who's ky dimension changes depending on the kx.
Best Answer