%% Plot Measurement and State Variable IRFs
% Explicitly create the state-space model
% \begin{array}{l}
% x_t=0.5x_{t-1}+0.2u_t
% \\
% y_t=2x_t + 0.01\varepsilon_t.
% \end{array}

A = 0.5;
B = 0.2;
C = 2;
D = 0.01;
Mdl = ssm(A,B,C,D)

% Mdl is an ssm model object.  Because all parameters have known values, the object is fully specified.
% Plot the IRFs of the measurement and state variables.

irfplot(Mdl);

% The plot entitled U1 -> Y1 is the IRF of y_t, and the plot entitled U1 -> X1 is the IRF of x_t. Both IRFs indicate that the effects of the shock on the system diminish after about 8 periods.
% Copyright 2020 The MathWorks, Inc.
%