can help check this ? i cant run this all command keep error

1 次查看(过去 30 天)
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)

回答(1 个)

Shadaab Siddiqie
Shadaab Siddiqie 2020-11-17
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.

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by