lsimplot
Plot simulated time response of dynamic system to arbitrary inputs
Syntax
Description
The lsimplot function plots the simulated time response of a
dynamic system
model to arbitrary inputs. To
customize the plot, you can return an LSimPlot object and modify it using dot
notation. For more information, see Customize Linear Analysis Plots at Command Line.
To obtain time response data, use the lsim function.
lsimplot(
plots the simulated time response of the model sys,u,t)sys for input signal
u and corresponding time vector t.
If sys is a multi-input, multi-output (MIMO) model, then the
lsimplot function creates a grid of plots with each plot displaying the
response of one input-output pair.
If sys is a model with
complex coefficients, then the plot shows both the real and imaginary components of the
response on a single axes and indicates the imaginary component with a diamond marker. You
can also view the response using magnitude-phase and complex-plane plots. (since R2025a)
lsimplot(___, plots
the simulated response with the plotting options specified in
plotoptions)plotoptions. Settings you specify in
plotoptions override the plotting preferences for the current
MATLAB® session. This syntax is useful when you want to write a script to generate
multiple plots that look the same regardless of the local preferences.
lsimplot(___, specifies
response properties using one or more name-value arguments. For example,
Name=Value)lsimplot(sys,LineWidth=1) sets the plot line width to 1. (since R2026a)
When plotting responses for multiple systems, the specified name-value arguments apply to all responses.
The following name-value arguments override values specified in other input arguments.
InitialCondition— Overrides initial conditions specified usingICInterpolationMethod— Overrides interpolation method specified usingmethodParameter— Overrides parameter values specified usingpColor— Overrides colors specified usingLineSpecMarkerStyle— Overrides marker styles specified usingLineSpecLineStyle— Overrides line styles specified usingLineSpec
lsimplot( plots the
simulated response in the specified parent graphics container, such as a
parent,___)Figure or TiledChartLayout, and sets the
Parent property. Use this syntax when you want to create a plot in
a specified open figure or when creating apps in App Designer.
lsimplot( opens the Linear Simulation
Tool for simulating sys)sys.
plots the
simulated response or opens the Linear Simulation Tool and returns the
corresponding chart object. To customize the appearance and behavior of the response plot,
modify the chart object properties using dot notation.lp = lsimplot(___)









