which one of these is the right sol.? and let me know my mistakes please ..
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Rama a
el 5 de Jun. de 2021
Respondida: Sulaymon Eshkabilov
el 15 de Jun. de 2021
xb (t)= r(t ) - r(t-A ) - r(t-B ) + r(t-C )
A = 3, B = 4 and C = 4.
which one of these is the right sol.
and let me know my mistakes please
syms Xb t;
y1=t.*heaviside(t);
y2=(t-3).*heaviside(t-3);
y3=(t-4).*heaviside(t-4);
y4=(t-4).*heaviside(t-4);
Xb=y1-y2-y3+y4;
fplot(Xb);
xlabel('t');
ylabel('Xb(t)');
title (' xb(t)= r(t ) - r(t-3 ) - r(t-4 ) + r(t-4 ) ');
***************************************************************
syms t
A=3
B=4
C=4
t= 0: 0.02:5;
u=t>= 0;
u1=t>= 1;
X= t.*u-(t-A).*u1-(t-B).*u1+(t-C).*u1;
plot(t,X)
0 comentarios
Respuesta aceptada
Sulaymon Eshkabilov
el 5 de Jun. de 2021
Both are accurate and you can get the same results by changing this in the 1st one:
fplot(Xb, [0, 5]);
In the second one, you should not make t symbolic.
Note that the second one is computationally more efficient.
1 comentario
Más respuestas (1)
Sulaymon Eshkabilov
el 15 de Jun. de 2021
Both gives the same results, if you fix in the second one the time boundary value for u1.
...
A=3;
B=4;
C=4;
t= 0: 0.02:5;
u=t>= 0;
u1=t>= 3; % Start at 3rd second
X= t.*u-(t-A).*u1-(t-B).*u1+(t-C).*u1;
plot(t,X, 'r*--')
0 comentarios
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!