Clear Filters
Clear Filters

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

1 view (last 30 days)
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
Shadaab Siddiqie on 17 Nov 2020
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.

Tags

Community Treasure Hunt

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

Start Hunting!