Problem writing built in code for Fast Fourier Transform

조회 수: 1 (최근 30일)
Issara Laosuwan
Issara Laosuwan 2016년 6월 1일
답변: Walter Roberson 2016년 6월 1일
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 :((

답변 (1개)

Walter Roberson
Walter Roberson 2016년 6월 1일
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?

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by