Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Bode plot of frequency response, or magnitude and phase data

`bode(sys)`

`bode(sys1,sys2,...,sysN)`

`bode(sys1,PlotStyle1,...,sysN,PlotStyleN)`

`bode(___,w)`

```
[mag,phase,wout]
= bode(sys)
```

```
[mag,phase,wout]
= bode(sys,w)
```

```
[mag,phase,wout,sdmag,sdphase]
= bode(sys,w)
```

`bode(`

creates
a Bode plot of the frequency response of a dynamic
system model `sys`

)`sys`

. The plot displays
the magnitude (in dB) and phase (in degrees) of the system response
as a function of frequency. `bode`

automatically
determines frequencies to plot based on system dynamics.

If `sys`

is a multi-input, multi-output (MIMO)
model, then `bode`

produces an array of Bode plots,
each plot showing the frequency response of one I/O pair.

`bode(sys1,sys2,...,sysN)`

plots the frequency
response of multiple dynamic systems on the same plot. All systems
must have the same number of inputs and outputs.

`bode(sys1,`

specifies
a color, linestyle, and marker for each system in the plot.`PlotStyle`

1,...,sysN,PlotStyleN)

`bode(___,`

plots
system responses for frequencies specified by `w`

)`w`

.

If

`w`

is a cell array of the form`{wmin,wmax}`

, then`bode`

plots the response at frequencies ranging between`wmin`

and`wmax`

.If

`w`

is a vector of frequencies, then`bode`

plots the response at each specified frequency.

You can use `w`

with any of the input-argument
combinations in previous syntaxes.

When you need additional plot customization options, use

`bodeplot`

instead.

`bode`

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,

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