Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

diag

Diagonalize vector of uncertain matrices and systems

Syntax

v = diag(x)

Description

If x is a vector of uncertain system models or matrices, diag(x) puts x on the main diagonal. If x is a matrix of uncertain system models or matrices, diag(x) is the main diagonal of x. diag(diag(x)) is a diagonal matrix of uncertain system models or matrices.

Examples

The statement produces a diagonal system mxg of size 4-by-4. Given multivariable system xx, a vector of the diagonal elements of xxg is found using diag.

x = rss(3,4,1); 
xg = frd(x,logspace(-2,2,80)); 
size(xg) 

FRD model with 4 output(s) and 1 input(s), at 80 frequency point(s). 

mxg = diag(xg); 
size(mxg) 
FRD model with 4 output(s) and 4 input(s), at 80 frequency point(s). 

xxg = [xg(1:2,1) xg(3:4,1)]; 
m = diag(xxg); 
size(m) 
FRD model with 2 output(s) and 1 input(s), at 80 frequency point(s). 

See Also

Introduced before R2006a

Was this topic helpful?