why it doesnt return inverse fourier transfrom?

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

Réponses (1)

David Goodmanson
David Goodmanson le 11 Nov 2017
Modifié(e) : David Goodmanson le 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

Cette question est clôturée.

Tags

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by