Stateflow User's Guide Previous page   Next Page

Initializing Data from the MATLAB Base Workspace

Stateflow lets you initialize data from the MATLAB base workspace. Initializing data from the MATLAB base workspace requires that you define data in both the MATLAB base workspace and Stateflow as follows:

  1. In Stateflow, define data that you want to initialize from the MATLAB workspace with a scope of Local or Output.
  2. In the Data properties dialog for the data, in the Value Attributes page, for the Initialize from field, select Workspace.
  1. You can also set this data property in the Contents pane of the Model Explorer as follows:

    1. Click the row for the data to highlight it.
    2. In the highlighted row click the 0 value under the InitFromWorkspace field.
    1. Click the check box to check it and click outside the row to see a value of 1 replace the check box.
  1. Define a variable of the same name in the MATLAB base workspace.

When simulation starts, the data is resolved.


Previous page  Bringing Simulink Parameters into Stateflow Saving Data to the MATLAB Workspace Next page

© 1994-2005 The MathWorks, Inc.