Simulink.BlockDiagram.getInitialState
Get initial state data from block diagram
Description
compiles the model specified by x0
= Simulink.BlockDiagram.getInitialState(mdlName
)mdlName
and returns the initial
values for block states in the model, including states for blocks inside referenced models.
If the Format parameter value for the model is
Dataset
, thenx0
is aSimulink.SimulationData.Dataset
object that contains the initial state information for blocks in the model.If the Format parameter for the model is anything other than
Dataset
, thenx0
is a structure that contains the initial state information for blocks in the model.
You can use this initial state information to specify initial block state values for simulation or to provide an initial condition for linearization. You can use the state information as-is, or you can modify individual state values or remove state values from the structure if you want to specify state information for a subset of block states.
To simulate a model from an initial simulation state or operating point, consider
using a Simulink.op.ModelOperatingPoint
object instead. The
ModelOperatingPoint
object contains complete information about
the model operating point, including block states, hidden block states, the state of
the solver and execution engine, and output values for some blocks. For more
information, see Specify Initial State for Simulation.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2006b