Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
milton
milton el 6 de Nov. de 2020
Comentada: milton el 11 de Nov. de 2020
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 comentarios
Debasish Samal
Debasish Samal el 10 de Nov. de 2020
Editada: Debasish Samal el 10 de Nov. de 2020
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 el 11 de Nov. de 2020
Thank you, Debasish Samal! It was really helpful the MATLAB Answer that you post!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by