MATLAB: How to obtain the matrices A, B, C ,D of the state space for a transfer matrix using Matlab

controlControl System ToolboxMATLAB

Suppose I have a transfer matrix:
xa.PNG
how can I obtain the matrices A, B, C ,D of the state space for this matrix using Matlab?

Best Answer

Try this:
s = tf('s');
P = [2/(s^2+3*s+2) 2*s/(s^2+3*s+2); -2*s/(s^2+3*s+2) -2/(s^2+3*s+2)]
S = ss(P)
producing:
S =
A =
x1 x2 x3 x4
x1 -3 -2 0 0
x2 1 0 0 0
x3 0 0 -3 -2
x4 0 0 1 0
B =
u1 u2
x1 2 0
x2 0 0
x3 0 2
x4 0 0
C =
x1 x2 x3 x4
y1 0 1 1 0
y2 -1 0 0 -1
D =
u1 u2
y1 0 0
y2 0 0
Continuous-time state-space model.