Problem writing built in code for Fast Fourier Transform

1 visualización (últimos 30 días)
Issara Laosuwan
Issara Laosuwan el 1 de Jun. de 2016
Respondida: Walter Roberson el 1 de Jun. de 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 :((

Respuestas (1)

Walter Roberson
Walter Roberson el 1 de Jun. de 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?

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by