| Stateflow User's Guide | ![]() |
Defining Function Data
Before you can finish a function, you need to define all or some of its data. Use the following steps to defined data for a Stateflow function:
If you right-click a data row in the Model Explorer and select Properties from the resulting pop-up menu, its Data dialog appears. See Setting Data Properties in the Data Dialog for information on setting data properties.
All data items (other than arguments and return values) parented by a function can be initialized from the workspace. However, only local items can be saved to the workspace.
It is not necessary to assign local data to an embedded MATLAB function. You can declare local data in an embedded MATLAB function simply by using it. In this case, Stateflow uses first use assignments to determine the type, size, and value of the local data. See Declaring Variables Implicitly in Simulink documentation for specific rules in declaring local data in Embedded MATLAB functions.
| Programming Functions | Calling Functions in Stateflow | ![]() |
© 1994-2005 The MathWorks, Inc.