gram
Computes the observability and controllability Gramians.
Syntax
W = gram(SYS, 'c')
W = gram(SYS, 'o')
Inputs
- SYS
 - A stable state-space model.
 - 'o' or 'c'
 - A character.
- 'c'
 - Controllability.
 - 'o'
 - Observability.
 
 
Outputs
- W
 - The Gramian of the state-space model.
 
Example
a = [-1 0 0; 1/2 -1 0; 1/2 0 -1];
b = [1 0; 0 -1; 0 1];
c = [0 0 1; 1 1 0];
sys = ss (a, b, c,[]);
Wc = gram (sys, 'c')
Wo = gram (sys, 'o')Wc = [Matrix] 3 x 3
0.50000   0.12500   0.12500
0.12500   0.56250  -0.43750
0.12500  -0.43750   0.56250
Wo = [Matrix] 3 x 3
0.87500  0.62500  0.12500
0.62500  0.50000  0.00000
0.12500  0.00000  0.50000Comments
WC = gram(SYS, 'o') computes the observability Gramian of the state-space model SYS.
WC = gram(SYS, 'c') computes the controllability Gramian of the state-space model SYS.