x(t) = Λ(t/4)[Π((​t+4)/6)+Π(​(t-4)/6)]+​Λ(t), t = [-10,10]

3 次查看(过去 30 天)
milton
milton 2020-11-6
评论: milton 2020-11-11
Hi,
I am new in MatLab and I am having some trouble plotting the above x(t)using the rectpuls and i'm not sure where i am going wrong. By default the code must be like that:
step = 0.01;
t =
xt =
figure(1)
I tried the below code but something is wrong with the tripuls's arguments.[Ihave seen that it's form is tripuls(t,w,s), where w is the width where here is 0.25? and s is the skew, where here is ...?]. In the paper I have found that: Π((t+4)/6)+Π((t-4)/6) = Π(t/6+4/6)+Π(t/6-4/6) = Π(t/(2*3)) + Π(4/6) + Π(t/(2*3) - Π(4/6) =[ Π(4/6) = 0]=u(t+3) - u(t-3) - u(t+3) + u(t-3) = 0. So finally x(t) = Λ(t), but what about the code?
step = 0.01;
t = -10:step:10;
syms t
xt = tripuls(t,0,1)*((heaviside((t+4)/6)+heaviside((t-4)/6)))+ tripuls(t);
figure(1)
fplot(t,xt);
  4 个评论
Debasish Samal
Debasish Samal 2020-11-10
编辑:Debasish Samal 2020-11-10
Hi,
The 'tripuls' function accepts input arguments of type 'single' or 'double' but it is 'symbolic' in this case. Can you try using these data types instead?
If you want to plot unit step function without 'Heaviside', an example can be found in the following MATLAB Answer:
-Debasish
milton
milton 2020-11-11
Thank you, Debasish Samal! It was really helpful the MATLAB Answer that you post!

请先登录,再进行评论。

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by