bodeplot
Plot Bode frequency response of dynamic system
Description
The bodeplot
function plots the Bode magnitude and phase of a
dynamic system model and returns a
BodePlot
chart object. To customize the plot, modify the properties of the
chart object using dot notation. For more information, see Customize Linear Analysis Plots at Command Line (Control System Toolbox).
To obtain frequency response data, use the bode
function.
Creation
Syntax
Description
plots the Bode magnitude and phase of the dynamic system model bp
= bodeplot(sys
)sys
and returns the corresponding chart object.
If sys
is a multi-input, multi-output (MIMO) model, then the
bodeplot
function creates a grid of Bode plots with each plot
displaying the frequency response of one input-output pair.
If sys
is a model with complex coefficients, then in:
Log frequency scale, the plot shows two branches, one for positive frequencies and one for negative frequencies. The plot also shows arrows to indicate the direction of increasing frequency values for each branch.
Linear frequency scale, the plot shows a single branch with a symmetric frequency range centered at a frequency value of zero.
plots the Bode frequency response with the plotting options specified in
bp
= bodeplot(___,plotoptions
)plotoptions
. Settings you specify in
plotoptions
override the plotting preferences for the current
MATLAB® session. This syntax is useful when you want to write a script to generate
multiple plots that look the same regardless of the local preferences.
plots the Bode response in the specified parent graphics container, such as a
bp
= bodeplot(parent
,___)Figure
or TiledChartLayout
, and sets the
Parent
property. Use this syntax when you want to create a plot
in a specified open figure or when creating apps in App Designer.
Input Arguments
Properties
Object Functions
addResponse (Control System Toolbox) | Add dynamic system response to existing response plot |
showConfidence | Display confidence regions on response plots for identified models |
Examples
Tips
Plots created using
bodeplot
do not support multiline titles or labels specified as string arrays or cell arrays of character vectors. To specify multiline titles and labels, use a single string with anewline
character.bodeplot(sys) title("first line" + newline + "second line");
Algorithms
The software computes the frequency response as follows:
Compute the zero-pole-gain (
zpk
(Control System Toolbox)) representation of the dynamic system.Evaluate the gain and phase of the frequency response based on the zero, pole, and gain data for each input/output channel of the system.
For continuous-time systems, the
bodeplot
function evaluates the frequency response on the imaginary axis s = jω and considers only positive frequencies.For discrete-time systems, the
bodeplot
function evaluates the frequency response on the unit circle. To facilitate interpretation, the command parameterizes the upper half of the unit circle as:where Ts is the sample time and ωN is the Nyquist frequency. The software then uses the equivalent continuous-time frequency ω as the x-axis variable. Because is periodic with period 2ωN, the
bodeplot
function plots the response only up to the Nyquist frequency ωN. Ifsys
is a discrete-time model with an unspecified sample time, thebodeplot
function uses Ts = 1.
Version History
Introduced before R2006aSee Also
bode
| bodeoptions
| showConfidence
Topics
- Customize Linear Analysis Plots at Command Line (Control System Toolbox)