Plotting system outputs together with different time intervals for each system? HELP!
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone,
I have 5 state space systems (time domain) that I'm trying to plot.
sys1 should run from t = 0 to t = a and after t=a the magnitude should be 0.
sys2 should run from t = 0 to t = b (where b > a) and after t=b the magnitude should be 0.
The same goes for sys3 sys4 and sys5 (t = c, d, e respectively where e>d>c>b>a).
Does anyone have any ideas how I can restrict the system outputs in the plot area?
Here is my code:
% Create the step responses for the Transfer Function & Simulink systems
t = linspace(0,t_cutoff,51);
y1 = step(sys1,t);
y2 = step(sys2,t);
y3 = step(sys3,t);
y4 = step(sys4,t);
y5 = step(sys5,t);
% Plot these step responses vs. time
plot(t,y1,'ro',t,y2,'b-',t,y3,':squarek',t,y4,'-*g',t,y5,'-xb'),grid
My code definitely works thus far, it plots all of the functions but it plots them longer than the intervals they are supposed to cover (i.e. system 1's only sensible operation range is between t=0 and t=a, no other interval is even feasible)
Any help you can contribute is greatly appreciated! Thank you!
-Alex
0 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Plot Customization dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!