Skip to Main Content Skip to Search
Product Documentation

Rules for Using the SimState of a Chart

Limitations on Values You Can Modify

A SimState does not include information about these elements:

Therefore, you cannot modify the values of those elements.

Rules for Modifying Data Values

These rules apply when you modify data values:

Rules for Modifying State Activity

These rules apply when you use the setActive method on an exclusive (OR) leaf state:

Restriction on Continuous-Time Charts

After you load a SimState for a continuous-time chart, you can restart simulation from a nonzero time. However, you cannot modify the state activity or any data values, because the SimState for a continuous-time chart is read-only. For more information, see Summary of Rules for Continuous-Time Modeling.

No Partial Loading of a SimState

When you load a SimState, the complete simulation state is available as a variable in the MATLAB base workspace. You cannot perform partial loading of a SimState for a subset of chart objects.

Restriction on Copying SimState Values

Use the clone method to copy an entire SimState to a new variable (see Methods for Interacting with the SimState of a Chart). You cannot copy a subset of SimState values, because the clone method works only at the chart level.

Suppose that you obtain a handle to the SimState of your chart using these commands:

blockpath = 'model/chart';
c = xFinal.getBlockSimState(blockpath);

Assignment statements such as stateCopy = c.state, dataCopy = c.data, and simstateCopy = c do not work. These assignments create copies of object handles, not SimState values.

SimState Limitations That Apply to All Blocks in a Model

For a list of SimState limitations that apply to all blocks in a Simulink model, see Limitations of the SimState in the Simulink User's Guide.

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


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