Filter löschen
Filter löschen

Problem writing built in code for Fast Fourier Transform

1 Ansicht (letzte 30 Tage)
Issara Laosuwan
Issara Laosuwan am 1 Jun. 2016
Beantwortet: Walter Roberson am 1 Jun. 2016
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 :((

Antworten (1)

Walter Roberson
Walter Roberson am 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?

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by