Documentation 
impulse(Mdl)
impulse(Mdl,numObs)
Y = impulse(___)
impulse(Mdl) plots a discrete stem plot of the impulse response function for the regression model with ARIMA time series errors, Mdl, in the current figure window.
impulse(Mdl,numObs) plots the impulse response function for numObs periods.
Y = impulse(___) returns the impulse response in a column vector for any of the previous input arguments.
To improve performance of the filtering algorithm, specify the number of observations, numObs, to include in the impulse response.
Mdl 
Regression model with ARIMA errors, as created by regARIMA or estimate. 
numObs 
Number of observations to include in the impulse response, specified as a positive integer. numObs is the number of periods for which impulse computes the impulse response. Default: impulse determines the number of observations using the polynomial division algorithm of the underlying lag operator polynomials, mldivide. 
Y 
Impulse responses of the model Mdl, specified as a column vector.

The impulse response function for regression models with ARIMA errors is the dynamic response of the system to a single impulse, or innovation shock, of unit size. The specific impulse response calculated by impulse is the dynamic multiplier, defined as the partial derivative of the output response with respect to an innovation shock at time 0.
For a regression model with ARIMA errors, y_{t}, unconditional disturbances u_{t}, and innovation series ε_{t}, the impulse response at time j, Ψ_{j}, is given by
$${\psi}_{j}=\frac{\partial {y}_{j}}{\partial {\epsilon}_{0}}=\frac{\partial {u}_{j}}{\partial {\epsilon}_{0}}.$$
Expressed as a function of time, the sequence of dynamic multipliers, Ψ_{1}, Ψ_{2},..., measures the sensitivity of the process to a purely transitory change in the innovation process. impulse computes the impulse response function by shocking the system with a unit impulse ε_{0} = 1, with all past observations of y_{t} and all future shocks of ε_{t} set to 0. The impulse response function is the partial derivative of the ARIMA process with respect to an innovation shock at time 0. Because of this, the presence of an intercept or a regression component corresponding to predictors in the model has no effect on the output.
This impulse response is sometimes called the forecast error impulse response, because the innovations, ε_{t}, can be interpreted as the onestepahead forecast errors.
If you specify the number of observations, numObs, impulse computes the impulse response by filtering a unit shock followed by an appropriate length vector of 0s. The filtering algorithm is very fast and results in an impulse response of known (numObs) length.
If you do not specify numObs, then impulse converts the error model to a truncated, infinitedegree moving average using the relatively slow lag operator polynomial division algorithm. This produces an impulse response of generally unknown length.
[1] Box, G. E. P., G. M. Jenkins, and G. C. Reinsel. Time Series Analysis: Forecasting and Control 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.
[2] Enders, W. Applied Econometric Time Series. Hoboken, NJ: John Wiley & Sons, 1995.
[3] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.
[4] Lütkepohl, H. New Introduction to Multiple Time Series Analayis. New York, NY: SpringerVerlag, 2007.