Main Content

Plot Impulse and Step Response at the Command Line

You can plot impulse- and step-response plots using the impulseplot and stepplot commands, respectively. If you want to fetch the response data, use impulse and step instead.

All plot commands have the same basic syntax, as follows:

  • To plot one model, use the syntax command(model).

  • To plot several models, use the syntax command(model1,model2,...,modelN).

In this case, command represents any of the plotting commands.

To display confidence intervals for a specified number of standard deviations, use the following syntax:

h = impulseplot(model);
showConfidence(h,sd);

where h is the plot handle returned by impulseplot. You could also use the plot handle returned by stepplot. sd is the number of standard deviations of a Gaussian distribution. For example, a confidence value of 99% for the nominal model curve corresponds to 2.58 standard deviations.

Alternatively, you can turn on the confidence region view interactively by right-clicking on the plot and selecting Characteristics > Confidence Region. Use the plot property editor to specify the number of standard deviations.

The following table summarizes commands that generate impulse- and step-response plots. For detailed information about each command, see the corresponding reference page.

CommandDescriptionExample
impulse,impulseplot

Plot impulse response for idpoly, idproc, idtf, idss, and idgrey model objects.

Note

Does not support nonlinear models.

To plot the impulse response of the model sys, type the following command:

impulse(sys)
step,stepplot

Plots the step response of all linear and nonlinear models.

To plot the step response of the model sys, type the following command:

step(sys)

To specify the step level offset (u0) and amplitude (A) for a model:

opt = RespConfig;
opt.InputOffset = u0; 
opt.Amplitude = A; 

step(sys,opt)

 More About