PlotOptions and Legend for Step Response
45 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I am facing a small issue with formatting my step response plots.
I have a state space description with
2 states, 1 input, 3 outputs
A = 2X2 matrix
B = 2X1 matrix
C = 3X2 matrix
D = 3X1 matrix
I have five different values of inputs. 3, 20, 30, 40, 60 and want to plot a single step response to compare the responses. To find a way around this i created
A as a 2X2X5 matrix and
C as a 3X2X5 matrix and then use the following functions.
sys = ss(A,B,C,D)
tf_sys = tf(sys)
When i use step(tf_sys). I am getting the correct step responses but all are of the same color and there is no legend. How can I modify plot style and enable legend for such a plot.
0 comentarios
Respuestas (1)
Azzi Abdelmalek
el 27 de Nov. de 2013
Editada: Azzi Abdelmalek
el 27 de Nov. de 2013
You can create your own plot and legend
A=[-11 -10;1 0];
B=[1;0];
C=eye(2);
D=[0;0];
sys=ss(A,B,C,D)
[x,t]=step(sys)
plot(t,x)
legend({'c1','c2'})
0 comentarios
Ver también
Categorías
Más información sobre Legend 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!