Bode Plot Axis Change

485 ビュー (過去 30 日間)
Robert
Robert 2015 年 7 月 23 日
回答済み: Jonathan Espín Martin 2017 年 12 月 14 日
Hello Im trying to learn the bode plot tool
Here is what i have
Here is my tf function Am i inputting it correct? The plot is not correct (.001*S)/(.0000005S^2 + .0017*s +1)
num = [.001];
denom = [ .0000005, .0017, 1];
g = tf(num, denom);
bode(g),grid
I get a nice bode plot from this however the max magnitude is not where its suppose to be on the plot. It is self scaling to -60dB I need to change the scale somehow to see what is going on at -4 dB for example.
Can someone help please?

採用された回答

Robert
Robert 2015 年 7 月 23 日
All, i figured out my issue and maybe this will help someone in the future.
My numerator has the highest power of S as the 1st power. You must include all the powers of S all the way down to S to the zero power. There for the numerator vector must have a zero for the second component This solved my issue and the scaling is now correct also

その他の回答 (1 件)

Jonathan Espín Martin
Jonathan Espín Martin 2017 年 12 月 14 日
First of all your numerator is not well settled
num=[0.001 0];
That mistake will be ignored. Unfortunately there's not an easy way to fix the axis limits using the bode command. However, there's a simply code that may be useful.
close all;
num=0.001;
den=[5e-7 0.0017 1];
g=tf(num,den);
opts1=bodeoptions('cstprefs');
opts1.PhaseVisible = 'off';
opts1.YLim={[-140 -50]};
Mag=subplot(2,1,1);bodeplot(g,opts1); grid on;
set(xlabel(''),'visible','off');
opts2=bodeoptions('cstprefs');
opts2.MagVisible = 'off';
opts2.YLim={[-180 0]};
Phase=subplot(2,1,2);bodeplot(g,opts2); grid on; title('');
Referring to the lines of the code, you may be able to change the Magnitud and Phase, in this example [-140 50] and [-180 0] are good options.
opts1.YLim={[-140 -50]};
opts2.YLim={[-180 0]};
I advice to previously plot the Bode Diagram to determine these values and change them as you wish. The final result looks like.

カテゴリ

Help Center および File ExchangePlot Customization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by