%% Compute Measurement Variable IRF
% 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 a ssm model object.  Because all parameters have known values, the object is fully specified.
% Compute the IRF of the measurement variable.

responseY = irf(Mdl)

% responseY is a 20-by-1 vector representing the 20-period IRF of the measurement variable y_t.  responseY(5) is 0.0250, which means that the response of y_t at period 5, to a unit shock to the state disturbance u_t at period 1, is 0.0250.
% Copyright 2020 The MathWorks, Inc.