%% Plot an Impulse Response Function
% Specify the AR(2) model,
% {y_t} = 0.5{y_{t - 1}} - 0.7{y_{t - 2}} + {\varepsilon _t}.

Mdl = arima('AR',{0.5,-0.7},'Constant',0)

%
% Plot the impulse response function without specifying the number of observations.

impulse(Mdl)

% The model is stationary; the impulse response function decays in a sinusoidal pattern.
% Copyright 2015 The MathWorks, Inc.