bodemag
Magnitude-only Bode plot of frequency response
Syntax
Description
bodemag enables you to generate magnitude-only plots to
visualize the magnitude frequency response of a dynamic system.
For more comprehensive and customizable plotting function, see bodeplot.
To obtain magnitude and phase data, see bode.
bodemag( creates a Bode
magnitude plot of the frequency response of the dynamic
system model
sys)sys. The plot displays the magnitude (in dB) of the system
response as a function of frequency. bodemag automatically
determines frequencies to plot based on system dynamics.
If sys is a multi-input, multi-output (MIMO) model, then
bodemag produces an array of Bode magnitude plots in
which each plot shows the frequency response of one I/O 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. See Bode Plot of Model with Complex Coefficients.
Linear frequency scale, the plot shows a single branch with a symmetric frequency range centered at a frequency value of zero.
bodemag(___,
specifies response properties using one or more name-value arguments. For
example, Name=Value)bodemag(sys,LineWidth=1) sets the plot line width to
1.
When plotting responses for multiple systems, the specified name-value arguments apply to all responses.
The following name-value arguments override values specified in other input arguments.
plots
the Bode magnitude response and returns the corresponding chart object. To
customize the appearance and behavior of the response plot, modify the chart
object properties using dot notation.bp = bodemag(___)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Algorithms
The software computes the frequency response as follows:
Compute the zero-pole-gain (
zpk) 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
bodemagfunction evaluates the frequency response on the imaginary axis s = jω and considers only positive frequencies.For discrete-time systems, the
bodemagfunction 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
bodemagfunction plots the response only up to the Nyquist frequency ωN. Ifsysis a discrete-time model with an unspecified sample time, thebodemagfunction uses Ts = 1.
Alternative Functionality
You can also create a magnitude-only frequency response using bodeplot. To do so, set the PhaseVisible property
of the bodeplot chart object to "off".
bp = bodeplot(sys);
bp.PhaseVisible = "off";




