I am new to IDL. I want to minimize code. I am writing this
for x=0,(pixel-1) do begin
for y=0,(pixel-1) do begin
for z=0,(pixel-1) do begin
Bx[x,y,z]=-(n*3.14/pixel)*cos(n*3.14*x/pixel)*sin(m*3.14*y/pixel)*exp(-sqrt(n^2+m^2)*3.14*z/pixel)
endfor
endfor
endfor
And I want to reduce to something like
x=dindgen(pixel)
y=dindgen(pixel)
z=dindgen(pixel)
Bx[x,y,z]=-(n*3.14/pixel)*cos(n*3.14*x/pixel)*sin(m*3.14*y/pixel)*exp(-sqrt(n^2+m^2)*3.14*z/pixel)
How can I do it?