Change ylabels on Bode plot

조회 수: 10 (최근 30일)
Oak Lore
Oak Lore 2015년 6월 21일
댓글: Walter Roberson 2015년 6월 27일
I want to change the ylabels on a Bode plot. As you know with the command bode there are two plots, one for magnitude and one for phase. But when you write:
ylabel('TheLabel')
Only the word "Phase" is changed to "TheLabel", but the word "Magnitude" is unchanged.
How do you write in order to change both the word "Magnitude" and the word "Phase"?

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 21일
편집: Azzi Abdelmalek 2015년 6월 21일
bode(tf(1,1:2)) % Example
axes=findobj('type','axes')
h_magnitude=get(axes(2),'YLabel')
h_phase=get(axes(1),'YLabel')
set(h_magnitude,'String','NewMagnitude')
set(h_phase,'String','NewPhase')
  댓글 수: 4
Oak Lore
Oak Lore 2015년 6월 21일
How do you write then? Can you post the code please?
Walter Roberson
Walter Roberson 2015년 6월 27일
s=zpk('s');
p1=1;
Hs=1/(1+s/p1);
bode(Hs, {0.1,10})
axes=findobj('type','axes')
h_magnitude=get(axes(2),'YLabel')
h_phase=get(axes(1),'YLabel')
set(h_magnitude,'String','NewMagnitude')
set(h_phase,'String','NewPhase')

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

카테고리

Help CenterFile Exchange에서 Get Started with Control System Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by