# 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 a more comprehensive function, see `bode`

. `bode`

provides magnitude
and phase information. If you have System Identification™ toolbox,
`bode`

also returns the computed values, including statistical
estimates.

For more customizable plotting options, see `bodeplot`

.

`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.

## Examples

## Input Arguments

## 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,

`bode`

evaluates the frequency response on the imaginary axis*s*=*jω*and considers only positive frequencies.For discrete-time systems,

`bode`

evaluates the frequency response on the unit circle. To facilitate interpretation, the command parameterizes the upper half of the unit circle as:$$z={e}^{j\omega {T}_{s}},\text{\hspace{1em}}0\le \omega \le {\omega}_{N}=\frac{\pi}{{T}_{s}},$$

where

*T*is the sample time and_{s}*ω*is the Nyquist frequency. The equivalent continuous-time frequency_{N}*ω*is then used as the*x*-axis variable. Because $$H\left({e}^{j\omega {T}_{s}}\right)$$ is periodic with period 2*ω*,_{N}`bode`

plots the response only up to the Nyquist frequency*ω*. If_{N}`sys`

is a discrete-time model with unspecified sample time,`bode`

uses*T*= 1._{s}

## Alternative Functionality

You can also create a magnitude-only frequency response using `bodeplot`

. To do so, set the `PhaseVisible`

property
of the `bodeplot`

object to `"off"`

.

```
bp = bodeplot(sys);
bp.PhaseVisible = "off";
```

## Version History

**Introduced in R2012a**