| Stateflow User's Guide | ![]() |
Setting Value Attribute Data Properties
The window tabbed Value Attributes in the Data dialog has the following appearance.
It includes the following settings:
Initialize from
Source of the initial value for this data item: either the Stateflow data dictionary or the MATLAB workspace.
Data Dictionary. If the source is the data dictionary, enter the initial value in the adjacent text field. Stateflow stores the value that you enter in the data dictionary.
MATLAB Workspace. If the source is the MATLAB workspace, this item gets its initial value from a similarly named variable in the MATLAB workspace. For example, suppose that the name of a Stateflow data item is A. If the MATLAB workspace has a variable named A, its value is used to initialize A in Stateflow.
If the initialized data item is an array, Stateflow sets each element of the Stateflow array to the value of the same element of the MATLAB array. Also, Stateflow vectors that you specify in Stateflow with one dimension are compatible with MATLAB row, and column vectors of the same size. For example, a Stateflow vector of entered size 5 is compatible with a MATLAB row vector of size [1,5], or column vector of size [5,1].
The following table summarizes the time of initialization for each data scope.
| Data Parent |
Scope |
When Initialized |
| Machine |
Local Exported Imported |
Start of simulation Start of simulation Not applicable |
| Chart |
Input Output Local |
Not applicable Start of simulation or when chart is reinitialized as part of an enabled Simulink subsystem |
| State with History Junction |
Local |
Start of simulation or when chart is reinitialized as part of an enabled Simulink subsystem |
| State without History Junction |
Local |
State activation (state entered) |
| Function (graphical, truth table, and embedded MATLAB) |
Input Output Local |
When function is invoked When function is invoked Start of simulation or when chart is reinitialized as part of an enabled Simulink subsystem |
Save final value to base workspace
Selecting this option causes the value of the data item to be assigned to a similarly named variable in the model's base workspace at the end of simulation.
Limit Range
This control group specifies values used by a Stateflow machine to check the validity of this data item. It includes the next two controls.
Minimum. Minimum value that this data item can have during execution or simulation of the Stateflow machine it belongs to.
Maximum. Maximum value that this data item can have during execution or simulation of the Stateflow machine it belongs to.
Watch in debugger
If selected, this option causes the debugger to halt if this data item is modified.
| Setting General Data Properties | Setting Description Data Properties | ![]() |
© 1994-2005 The MathWorks, Inc.