PlotOptions and Legend for Step Response
23 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Azzi Abdelmalek
2013 年 11 月 27 日
編集済み: Azzi Abdelmalek
2013 年 11 月 27 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!