%% Convert State-Space Model to Zero-Pole-Gain Model
% For this example, compute the zero-pole-gain model 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 zero-pole-gain model.

sys = zpk(ltiSys)

% Copyright 2020 The MathWorks, Inc.