# bode

Bode frequency response of dynamic system

## Syntax

## Description

`[`

computes the frequency response of dynamic
system model
`mag`

,`phase`

,`wout`

]
= bode(`sys`

)`sys`

and returns the magnitude and phase of the response at
each frequency in the vector `wout`

. The function
automatically determines frequencies in `wout`

based on
system dynamics.

`bode(___)`

plots the frequency response of
`sys`

with default plotting options for all of the
previous input argument combinations. The plot displays the magnitude (in dB)
and phase (in degrees) of the system response as a function of frequency. For
more plot customization options, use `bodeplot`

.

To plot responses for multiple dynamic systems on the same plot, you can specify

`sys`

as a comma-separated list of models. For example,`bode(sys1,sys2,sys3)`

plots the responses for three models on the same plot.To specify a color, line style, and marker for each system in the plot, specify a

`LineSpec`

value for each system. For example,`bode(sys1,LineSpec1,sys2,LineSpec2)`

plots two models and specifies their plot style. For more information on specifying a`LineSpec`

value, see`bodeplot`

.

## Examples

## Input Arguments

## Output Arguments

## Tips

When you need additional plot customization options, use

`bodeplot`

instead.

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

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

## Version History

**Introduced before R2006a**