- #1
UrIkOn
- 5
- 0
I use looping to implement this formula
https://www.physicsforums.com/attachment.php?
attachmentid=46840&stc=1&d=1335864568
But,when I run, mathlab will hang?Why?
https://www.physicsforums.com/attachment.php?
attachmentid=46840&stc=1&d=1335864568
But,when I run, mathlab will hang?Why?
Code:
%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
Attachments
Last edited: