can help check this ? i cant run this all command keep error
Show older comments
syms t w
% The expressions with variables t and w will be treated as symbolic expressions.
» x = str2sym('exp(-2*t)*Heaviside(t)')
% symbolically defines signal x, and the result is
x=
exp(-2*t)*heaviside(t)
» X = fourier(x)
% X is the symbolic Fourier transform (expressed in w) of x, and
the result is
x=
1/(2+w*li)
>>syms f
>>Xf=subs(X,w,2*pi*f)
Xf=
1/(pi*f^2i+2)
>>Xf_conj =subs(Xf,i,-i)
-1/(pi*f*2i-2)
» Gf = Xf*Xf_conj
Gf=
-1/((pi*f*2i-2)*(pi*f*2i+2))
» simplify(Gf)
ans =
1/(4*pi^2*f^2+4)
% Simplifying expression
% The following commands are related to plotting command
» subplot(2,1,1)
» ezplot(x,[-0.1,2.5])
» subplot(2,1,2)
» ezplot(Gf,-2,2)
Answers (1)
Shadaab Siddiqie
on 17 Nov 2020
0 votes
From my understanding you are getting an error while running the above commands. From what I see you can use "heaviside" instead of "Heaviside" since function name is case sensitive.
x = str2sym('exp(-2*t)*heaviside(t)')
Also to plot multiple images refer here.
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!