margin

Margin stability.

Syntax

margin(sys)

margin(sys, tol)

[gm, pm, Wgm, Wpm] = margin(...)

Inputs

sys
A linear time-invariant transfer function or state-space system.
Type: class
tol
The tolerance below which small values are ignored (default: sqrt(eps)).
Type: double
Dimension: scalar

Outputs

gm
The gain margin as a ratio, not in decibels.
Type: double
Dimension: scalar
p
The phase margin in degrees.
Type: double
Dimension: scalar
Wgm
The frequency at which the gain margin is assessed, also known as the phase crossover.
The units are radians/sec for continuous systems, and Hz for discrete systems.
Type: double
Dimension: scalar
Wpm
The frequency at which the phase margin is assessed, also known as the gain crossover.
The units are radians/sec for continuous systems, and Hz for discrete systems.
Type: double
Dimension: scalar

Example

Create the bode plot with the margin information for the system below.
s = tf('s');
GH = 10000 / ((s+10)*(s+20)*(s+30));
margin(GH);
Figure 1. margin Example


Comments

If the output arguments are omitted, the bode plot is displayed with the margin information.