Main Content


Plot impulse response and return plot handle


impulseplot(..., plotoptions)
h = impulseplot(...)


impulseplot plots the impulse response of the dynamic system model sys. For multi-input models, independent impulse commands are applied to each input channel. The time range and number of points are chosen automatically. For continuous systems with direct feedthrough, the infinite pulse at t=0 is disregarded. impulseplot can also return the plot handle, h. You can use this handle to customize the plot with the getoptions and setoptions commands. Type

help timeoptions 

for a list of available plot options.

impulseplot(sys) plots the impulse response of the LTI model without returning the plot handle.

impulseplot(sys,Tfinal) simulates the impulse response from t = 0 to the final time t = Tfinal. Express Tfinal in the system time units, specified in the TimeUnit property of sys. For discrete-time systems with unspecified sample time (Ts = -1), impulseplot interprets Tfinal as the number of sampling intervals to simulate.

impulseplot(sys,t) uses the user-supplied time vector t for simulation. Express t in the system time units, specified in the TimeUnit property of sys. For discrete-time models, t should be of the form Ti:Ts:Tf, where Ts is the sample time. For continuous-time models, t should be of the form Ti:dt:Tf, where dt becomes the sample time of a discrete approximation to the continuous system (see impulse). The impulseplot command always applies the impulse at t=0, regardless of Ti.

To plot the impulse response of multiple LTI models sys1,sys2,... on a single plot, use:




You can also specify a color, line style, and marker for each system, as in


impulseplot(AX,...) plots into the axes with handle AX.

impulseplot(..., plotoptions) plots the impulse response with the options specified in plotoptions. Type

help timeoptions 

for more detail.

h = impulseplot(...) plots the impulse response and returns the plot handle h.


Example 1

Normalize the impulse response of a third-order system.

sys = rss(3);
h = impulseplot(sys);
% Normalize responses

Example 2

Plot the impulse response and the corresponding 1 std "zero interval" of an identified linear system.

load(fullfile(matlabroot, 'toolbox', 'ident', 'iddemos', 'data', 'dcmotordata'));
z = iddata(y, u, 0.1, 'Name', 'DC-motor');
set(z, 'InputName', 'Voltage', 'InputUnit', 'V');
set(z, 'OutputName', {'Angular position', 'Angular velocity'});
set(z, 'OutputUnit', {'rad', 'rad/s'});
set(z, 'Tstart', 0, 'TimeUnit', 's');
model = n4sid(z,4,n4sidOptions('Focus', 'simulation'));
h = impulseplot(model,2);


You can change the properties of your plot, for example the units. For information on the ways to change properties of your plots, see Ways to Customize Plots.

Introduced before R2006a