How to get the answer from ifourier function?

3 views (last 30 days)
I try to get the inverse fourier by ifourier.
The programming is below.
clc
clear
syms t f
rect=@(x)rectangularPulse(x);
tri=@(x)triangularPulse(x);
T0=0.01;
B=150;
tt=-200:0.111:200;
m_t=tri(t/T0);
m_f=fourier(subs(m_t,t,t/(2*pi))/(2*pi),t,f);
b_f=rect(f/(2*B));
bm_f=m_f*b_f;
bm_t=ifourier(subs(bm_f,f,f/(2*pi)),f,t);
bm_t_d=abs(subs(bm_t,t,tt));
plot(tt,bm_t_d);
However, finally, I just got "Error using plot Non-numeric data is not supported in 'Line'".
What should I do?

Answers (1)

Vandana Rajan
Vandana Rajan on 19 Dec 2016
Hi Sijie Cheng,
Since you are using symbolic expression, you should use the command 'fplot' instead of 'plot'.
Please use the MATLAB documentation link below for details on 'fplot'.
https://www.mathworks.com/help/symbolic/fplot.html

Tags

Products

Community Treasure Hunt

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

Start Hunting!