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

Answers (1)

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.

Tags

Asked:

on 11 Nov 2017

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!