Simulink.BlockDiagram.getInitialState - Return initial state structure of block diagram

Syntax

x0 = Simulink.BlockDiagram.getInitialState(mdl)

Description

x0 = Simulink.BlockDiagram.getInitialState(mdl) returns the initial state structure of the block diagram specified by the input argument mdl. This state structure can be used to specify the initial state vector in the Configuration Parameters dialog box or to provide an initial state condition to the linearization commands.

The command returns x0, a structure of the form

time: 0
signals: [1xn struct]

where n is the number of states contained in the model, including any models referenced by Model blocks. The signals field is a structure of the form

values: [1xm double]
dimensions: [1x1 double]
label: [char array]
blockName: [char array]
inReferencedModel: [bool]
sampleTime: [1x2 double]

Using the state structure simplifies specifying initial state values for models with multiple states, as each state is associated with the full path to its parent block.

See Also

linmod

  


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