Plotting system outputs together with different time intervals for each system? HELP!
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
See Also
Categories
Find more on Plot Customization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!