www.gusucode.com > control 案例程序 matlab源码代码 > control/ConvertStateSpaceModelToTransferFunctionExample.m

    %% Convert State-Space Model to Transfer Function
% 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}} \right].$$
%
% Specify the state-space model.
sys = ss([-2 -1;1 -2],[1 1;2 -1],[1 0],[0 1]);

%%
% Convert this model to a transfer function.
tf(sys)