|On this page…|
Define temporary data when you want to use data that is only valid while a function executes. You can define temporary data in graphical, truth table, and MATLAB® functions in your chart. For example, you can designate a loop counter to have Temporary scope if the counter value does not need to persist after the function completes.
To define temporary data for a Stateflow® function, follow these steps:
In the Model Explorer, select the graphical, truth table, or MATLAB function that will use temporary data.
The Model Explorer adds a default definition for the data in the Stateflow hierarchy, with a scope set to Temporary by default.
Change other properties of the data if necessary, as described in Set Data Properties.