Skip to Main Content Skip to Search
Product Documentation

initialplot - Plot initial condition response and return plot handle

Syntax

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

Description

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

initialplot(sys1,sys2,...,sysN,x0)

initialplot(sys1,sys2,...,sysN,x0,Tfinal)

initialplot(sys1,sys2,...,sysN,x0,t)

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

initialplot(sys1,'r',sys2,'y--',sys3,'gx',x0).

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.

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.

Examples

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.

See Also

getoptions | initial | setoptions

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS