複数のボード線図に対​して一つのレジェンド​を付ける方法

조회 수: 5 (최근 30일)
貴弘
貴弘 2023년 10월 23일
편집: Atsushi Ueno 2023년 10월 23일
例えば下記のように複数のボード線図に対して,一つのレジェンドを付けたいのですが,方法を教えてください.
for i = 1:10
sys1 = tf(i,[1 1])
bode(sys1, 'b-')
hold on
end
sys2 = tf(20,[1 1])
bode(sys2, 'r--')
上記に対して,10個のボード線図(青の実線)にsys1,1個のボード線図(赤の破線)にsys2のようにレジェンドを付けたいです.

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 10월 23일
Working with bode-plot figures is difficult.
A (simple) approach is to use empty strings for the rest of the plots
figure
hold on
for i = 1:10
sys1 = tf(i,[1 1]);
bode(sys1, 'b-');
end
sys2 = tf(20,[1 1]);
bode(sys2, 'r--');
legend({'', '', '', '', '', '', '', '', '', 'Sys1', 'Sys2'})
  댓글 수: 2
貴弘
貴弘 2023년 10월 23일
Dyumanさん
Thank you for your answer!
I will accept your answer.
Dyuman Joshi
Dyuman Joshi 2023년 10월 23일
You are welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 応答の計算と可視化에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!