MATLAB Answers

Ytick Spacing on Bode Plot Magnitude

2 ビュー (過去 30 日間)
Curtis Binkley
Curtis Binkley 2019 年 11 月 9 日
Edited: darova 2019 年 11 月 9 日
Hello. I am trying to change the spacing between the yticks to be 5dB on the top plot ONLY on a bode plot. I want the magnitudes in dB to increase in steps of 5dB instead of 10dB as shown below. If I use the ytick command it changes only the bottom plot (which is phase angle in degrees). Please help! I realize I can go into property editor but I want to change it via command line. I don't know how to get my changes to save via property inspector and reflect on the command line code. Is there anyway to do this via command line?
Code
H = tf([wo2],[1 p wo2]);
P = bodeoptions;
P.FreqUnits = 'Hz';
P.ylim={[-42,20];[-182,0]};
P.XLimMode={'manual'};
P.YLimMode={'manual';'manual'};
bode(H,P)
xlim([100 100000])
Bode.PNG

  0 件のコメント

サインイン to comment.

件の回答 (1)

darova
darova 2019 年 11 月 9 日
If you are using subplot
ax1 = subplot(211);
plot(x1,y1)
ax2 = sbuplot(212);
plot(x1,y2);
set(ax1,'YTick',[1 2 3])
set(ax2,'YTick',[4 5 6])

  2 件のコメント

Curtis Binkley
Curtis Binkley 2019 年 11 月 9 日
Can you use subplot with the bode function? How would I do this with my code?
darova
darova 2019 年 11 月 9 日
Does bode have children?
h = get(gca,'children');
set(h(1),'YTick',[1 2 3])

サインイン to comment.

サインイン してこの質問に回答します。

製品


リリース

R2018b

Translated by