MATLAB: Transfer fuction representation needed

Control System Toolboxtransfer function

sys = ss(tf({1,1,1},{[1 .5 1],[1 1],[.7 .5 1]}));
need explanation

Best Answer

Hi,
this is a compact way to express 1 transfer function with 3 inputs and convert it to a state space representation.You can find this also as an similar example in the documentation of tf function for the case of 2 outputs. Consider:
>> sys = tf({1,1,1},{[1 .5 1],[1 1],[.7 .5 1]})
sys =
From input 1 to output:
1
---------------
s^2 + 0.5 s + 1
From input 2 to output:
1
-----
s + 1
From input 3 to output:
1
-------------------
0.7 s^2 + 0.5 s + 1
Continuous-time transfer function.
Now with the ss function, the 1x3 transfer function is converted to the correspondig state space representation of the system:
>> sys = ss(sys)
sys =
A =
x1 x2 x3 x4 x5
x1 -0.5 -1 0 0 0
x2 1 0 0 0 0
x3 0 0 -1 0 0
x4 0 0 0 -0.7143 -1.429
x5 0 0 0 1 0
B =
u1 u2 u3
x1 1 0 0
x2 0 0 0
x3 0 1 0
x4 0 0 1
x5 0 0 0
C =
x1 x2 x3 x4 x5
y1 0 1 1 0 1.429
D =
u1 u2 u3
y1 0 0 0
Continuous-time state-space model.
The code you posted in your question just combines both steps in one line of code.
sys = ss(tf({1,1,1},{[1 .5 1],[1 1],[.7 .5 1]}));
Best regards
Stephan