Problem writing built in code for Fast Fourier Transform
1 view (last 30 days)
Show older comments
Hello! I try to write my own built in code for Fast Fourier Transform to processed image with strong diagonal line with fftshift function
function out = myfft2(im,dim1,dim2,logflag)
if nargin==1
logflag = 1;
[dim1,dim2] = size(im);
elseif nargin==2
logflag = dim1;
[dim1,dim2] = size(im);
elseif nargin==3
logflag = 1;
end
if logflag
out = fftshift(log(abs(fft2(double(im),dim1,dim2))));
else
out = fftshift(abs(fft2(double(im),dim1,dim2)));
end
imshow(out,[])
After I have computed, it returned with errors:
>> myfft
Not enough input arguments.
Error in myfft (line 13)
if logflag
I still cannot figure out which part I did wrong :((
0 Comments
Answers (1)
Walter Roberson
on 1 Jun 2016
Your myfft2() code is written expecting at least one argument to be passed in the call, but you are not passing any argument. What is your expectation on how the value for "im" is going to be found?
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!