%% Convert State-Space Model to Transfer Function
% For this example, compute the transfer function of the following state-space model:
% A = \left[ {\begin{array}{*{20}{c}}
% { - 2}&{ - 1}\\
% 1&{ - 2}
% \end{array}} \right],\quad B = \left[ {\begin{array}{*{20}{c}}
% 1&1\\
% 2&{ - 1}
% \end{array}} \right],\quad C = \left[ {\begin{array}{*{20}{c}}
% 1&0
% \end{array}} \right],\quad D = \left[ {{\kern 1pt} \begin{array}{*{20}{c}}
% 0&1
% \end{array}} ].
% Create the state-space model using the state-space matrices.

A = [-2 -1;1 -2];
B = [1 1;2 -1];
C = [1 0];
D = [0 1];
ltiSys = ss(A,B,C,D);

%
% Convert the state-space model ltiSys to a transfer function.

sys = tf(ltiSys)

% Copyright 2012 The MathWorks, Inc.