Main Content


Plot initial condition response and return plot handle


initialplot(..., plotoptions)
h = initialplot(...)


initialplot(sys,x0) plots the undriven response of the state-space (ss) model sys with initial condition x0 on the states. This response is characterized by these equations:

Continuous time: x = A x, y = C x, x(0) = x0

Discrete time: x[k+1] = A x[k], y[k] = C x[k], x[0] = x0

The time range and number of points are chosen automatically. initialplot also returns 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.

initialplot(sys,x0,Tfinal) simulates the 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), initialplot interprets Tfinal as the number of sampling periods to simulate.

initialplot(sys,x0,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 0:Ts:Tf, where Ts is the sample time. For continuous-time models, t should be of the form 0:dt:Tf, where dt becomes the sample time of a discrete approximation to the continuous system (see impulse).

To plot the initial condition responses of several LTI models on a single figure, use




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


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

initialplot(..., plotoptions) plots the initial condition response with the options specified in plotoptions. Type

help timeoptions

for more detail.

h = initialplot(...) plots the system response and returns the plot handle h.


Plot a third-order system's response to initial conditions and use the plot handle to change the plot's title.

sys = rss(3);
h = initialplot(sys,[1,1,1])
p = getoptions(h); % Get options for plot.
p.Title.String = 'My Title'; % Change title in options.
setoptions(h,p); % Apply options to the plot.


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