# allmargin

Gain margin, phase margin, delay margin, and crossover frequencies

## Description

computes the gain margin, phase margin, delay margin, and the corresponding
crossover frequencies for the SISO or MIMO negative feedback loop with open-loop
response `S`

= allmargin(`L`

)`L`

. The negative feedback loop is computed as
`feedback(L,eye(M))`

, where `M`

is the number
of inputs and outputs in `L`

.

For a MIMO system, `allmargin`

returns loop-at-a-time stability
margins for the negative-feedback closed loop system. Use
`allmargin`

to find classical margins of any SISO or MIMO
model, including models with delays.

computes the gain and phase margins in the frequency range
[`S`

= allmargin(`L`

,Focus=`[fmin,fmax]`

)`fmin`

,`fmax`

], ignoring stability issues
outside this range. For instance, use this syntax to ignore very low frequency
dynamics for the purpose of computing stability margins. * (since R2024a)*

## Examples

## Input Arguments

## Output Arguments

## Tips

`allmargin`

assumes that the system with open-loop response`L`

is a negative-feedback system. To compute the classical stability margins of the positive feedback system`feedback(L,eye(M),+1)`

, use`allmargin(-L)`

.To compute classical margins for a system modeled in Simulink

^{®}, first linearize the model to obtain the open-loop response at a particular operating point. Then, use`allmargin`

to compute classical stability margins for the linearized system. For more information, see Stability Margins of a Simulink Model (Robust Control Toolbox).If you have Robust Control Toolbox™ software, you can use

`diskmargin`

(Robust Control Toolbox) to compute disk-based margins that define a range of "safe" gain and phase variations for which the feedback loop remains stable.

## Version History

**Introduced before R2006a**

## See Also

Linear System Analyzer | `margin`

| `diskmargin`

(Robust Control Toolbox)

### Topics

- Stability Margins of a Simulink Model (Robust Control Toolbox)