フィルターのクリア

how to store your outputs of your step response?

2 ビュー (過去 30 日間)
Nicholas
Nicholas 2013 年 10 月 15 日
コメント済み: Azzi Abdelmalek 2013 年 10 月 16 日
A = [0 0 1 0;0 0 0 1;-24 9 -3 0;4.5 -4.5 0 0]; B=[0 0;0 0;12 4;0 3.5]; C = [0 0 1 0;0 0 -3 0]; D = [0 0;0 0];
step(A,B,C,D)
how can i store the outputs of this step response so i can plot them together on a separate plot?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 15 日
A = [0 0 1 0;0 0 0 1;-24 9 -3 0;4.5 -4.5 0 0];
B=[0 0;0 0;12 4;0 3.5];
C = [0 0 1 0;0 0 -3 0];
D = [0 0;0 0];
s=ss(A,B,C,D)
[y,t]=step(s) % t is time vector
% output1 from input1
y11=y(:,1,1)
% output2 from input1
y21=y(:,2,1)
% output1 from input2
y12=y(:,1,2)
% output2 from input2
y22=y(:,2,2)
subplot(2,1,1)
plotyy(t,y11,t,y12)
title('output 1 & 2 from input 1')
subplot(2,1,2)
plotyy(t,y21,t,y22)
title('output 1 & 2 from input 2')
  8 件のコメント
Nicholas
Nicholas 2013 年 10 月 16 日
編集済み: Azzi Abdelmalek 2013 年 10 月 16 日
i think you mixed up your plots
isnt it supposed to be
plotyy(t,y11,t,y21)
title('output 1 & 2 from input 1')
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 16 日
You are right

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by