| Using Stateflow | Search  Help Desk |
Defining Temporary Data
Temporary data is non-persistent. Temporary data is accessible only by its parent. Defining a loop counter to be Temporary is a good use of this Scope since the value is used only as a counter and the value does not need to persist. The Temporary data remains defined and accessible only while the parent is executing. For a state, the Temporary data is defined when that state is active and processing state actions. For a chart, the Temporary data is defined and accessible when the chart is active and processing condition and/or transition actions. This is an example Stateflow diagram of an Analog to Digital converter that uses Temporary data.
Delay is used only as a counter in the loop. Once the delay loop is complete, the value of Delay is no longer needed. If you were interested only in whether the Low, Normal, or High state is active, the value of Temp could be defined as Temporary as well.