I use looping to implement this formula(adsbygoogle = window.adsbygoogle || []).push({});

https://www.physicsforums.com/attachment.php?

attachmentid=46840&stc=1&d=1335864568

But,when I run, mathlab will hang?Why?

Code (Text):%Import picture into Matlab

img=imread('picture.jpg','jpg');

img512=imresize(img, [512 512]);

imgGRAY=uint8(rgb2gray(img512));

figure(1);imshow(img);

figure(2);imshow(imgGRAY);

M=512;

N=512;

f=double(imgGRAY);

F=zeros(512);

for u=1:512

for v=1:512

TotalN=0;

for x=1:512

for y=1:512

TotalN=TotalN+(f(x,y)*exp(-1i*2*pi*(((u*x)/512)+((v*y)/512))));

end

end

F(u,v)=(1/(M*N))*TotalN;

end

end

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Why my mathlab will hang?

**Physics Forums | Science Articles, Homework Help, Discussion**