why it doesnt return inverse fourier transfrom?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
clc
n1=[77 -5 1 -5];
f=length(n1);
i=0;
t=zeros(f);
for i=1:f;
t(i)=ifft(n1(i));
end
for i=1:f;
disp(t(i));
end
Answers (1)
David Goodmanson
on 11 Nov 2017
Edited: David Goodmanson
on 13 Nov 2017
Hi jasleen,
It doesn't work because with the for loop you are giving ifft the elements of n1 one at a time. Each of those four times, the ifft operates on a single scalar number. But the ifft needs the entire vector n1 for input and outputs a vector of the same length:
n1=[77 -5 1 -5];
t = ifft(n1);
disp(t) % display the entire vector at once, too
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!