Bode Plot Axis Change
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (1)
Jonathan Espín Martin
le 14 Déc 2017
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.

1 commentaire
Anish Mitra
le 14 Nov 2025
Beginning in R2024b, the chart object returned by the "bodeplot" command can be modified directly using its properties.
For example,
num=0.001;
den=[5e-7 0.0017 1];
g=tf(num,den);
bp = bodeplot(g);
bp.PhaseVisible = 'off';
bp.YLimits = [-140 -50];
Catégories
En savoir plus sur Get Started with Control System Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!