| Control System Toolbox™ | ![]() |
h = bodeplot(sys)
bodeplot(sys)
bodeplot(sys1,sys2,...)
bodeplot(AX,...)
bodeplot(..., plotoptions)
bodeplot(sys,w)
h = bodeplot(sys) plot the Bode magnitude and phase of an LTI model sys and returns the plot handle h to the plot. You can use this handle to customize the plot with the getoptions and setoptions commands.
bodeplot(sys) draws the Bode plot of the LTI model sys (created with either tf, zpk, ss, or frd). The frequency range and number of points are chosen automatically.
bodeplot(sys1,sys2,...) graphs the Bode response of multiple LTI models sys1,sys2,... on a single plot. You can specify a color, line style, and marker for each model, as in
bodeplot(sys1,'r',sys2,'y--',sys3,'gx')
bodeplot(AX,...) plots into the axes with handle AX.
bodeplot(..., plotoptions) plots the Bode response with the options specified in plotoptions. Type
help bodeoptions
for a list of available plot options. See Example 2 for an example of phase matching using the PhaseMatchingFreq and PhaseMatchingValue options.
bodeplot(sys,w) draws the Bode plot for frequencies specified by w. When w = {wmin,wmax}, the Bode plot is drawn for frequencies between wmin and wmax (in rad/s). When w is a user-supplied vector w of frequencies, in rad/s, the Bode response is drawn for the specified frequencies.
See logspace to generate logarithmically spaced frequency vectors.
You can change the properties of your plot, for example the units. For information on the ways to change properties of your plots, see Ways to Customize Plots.
Use the plot handle to change options in a Bode plot.
sys = rss(5); h = bodeplot(sys); % Change units to Hz and make phase plot invisible setoptions(h,'FreqUnits','Hz','PhaseVisible','off');
The properties PhaseMatchingFreq and PhaseMatchingValue are parameters you can use to specify the phase at a specified frequency. For example, enter the following commands.
sys = tf(1,[1 1]); h = bodeplot(sys) % This displays a Bode plot.

Use this code to match a phase of 750 degrees to 1 rad/s.
p = getoptions(h);
p.PhaseMatching = 'on';
p.PhaseMatchingFreq = 1;
p.PhaseMatchingValue = 750; % Set the phase to 750 degrees at 1
% rad/s.
setoptions(h,p); % Update the Bode plot.

The first bode plot has a phase of -45 degrees at a frequency of 1 rad/s. Setting the phase matching options so that at 1 rad/s the phase is near 750 degrees yields the second Bode plot. Note that, however, the phase can only be -45 + N*360, where N is an integer, and so the plot is set to the nearest allowable phase, namely 675 degrees (or 2*360 - 45 = 675).
bode, bodeoptions, getoptions, setoptions
![]() | bodeoptions | c2d | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |