initialplot - Plot initial condition response and return plot handle

Syntax

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

Description

initialplot(sys,x0) plots the undriven response of the state-space model sys (created with ss) 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 time response from t=0 to the final time t=Tfinal. For discrete-time models with unspecified sample time, Tfinal should be the number of samples.

initialplot(sys,x0,t) specifies a time vector t to be used for simulation. For discrete systems, 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 of the continuous model.

initialplot(sys1,sys2,...,x0,t) plots the response of multiple LTI models sys1,sys2,... on a single plot. The time vector t is optional. 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.

Remarks

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.

Example

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

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS