impulseplot

Plot impulse response and return plot handle

Syntax

impulseplot(sys)
impulseplot(sys,Tfinal)
impulseplot(sys,t)
impulseplot(sys1,sys2,...,sysN)
impulseplot(sys1,sys2,...,sysN,Tfinal)
impulseplot(sys1,sys2,...,sysN,t)
impulseplot(AX,...)
impulseplot(..., plotoptions)
h = impulseplot(...)

Description

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 sampling 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:

impulseplot(sys1,sys2,...,sysN)

impulseplot(sys1,sys2,...,sysN,Tfinal)

impulseplot(sys1,sys2,...,sysN,t)

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

impulseplot(sys1,'r',sys2,'y--',sys3,'gx')

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.

Examples

Example 1

Normalize the impulse response of a third-order system.

sys = rss(3);
h = impulseplot(sys);
% Normalize responses
setoptions(h,'Normalize','on');

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);
showConfidence(h);

More About

expand all

Tips

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.

Was this topic helpful?