compreal
[csys, T] = compreal (sys)[csys, T] = compreal (sys, realization)Returns the state-space companion controllable ors observable form of the input system as well as the transformation matrix.
Inputs
LTI model.
The realization argument selects the companion form:
'c'Controllable companion form, the default if realization is omitted.
'o'Observable companion form.
Outputs
State-space model in companian form.
Transformation matix.
Given the state vector $$x(t)$$
We look for a transformation matrix such that
$$ x(t)=Tz(t) $$
Where T is our transformation matrix and $z(t)$ is our new state vector. Our new state-space is given by the following relationships:
$$ A_z = T^{-1}AT $$$$ B_z = T^{-1}B $$$$ C_z = CT $$$$ D_z = D $$
Alorithm based on
Source Code: compreal