Skip to Main Content Skip to Search
Product Documentation

Defining Temporary Data

When to Define Temporary Data

Define temporary data when you want to use data that persists only 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.

How to Define Temporary Data

To define temporary data for a Stateflow function, follow these steps:

  1. Open the Model Explorer.

  2. In the Model Explorer, select the graphical, truth table, or MATLAB function that will use temporary data.

  3. Select Add > Data.

    The Model Explorer adds a default definition for the data in the Stateflow hierarchy, with a scope set to Temporary by default.

  4. Change other properties of the data if necessary, as described in Setting Data Properties in the Data Dialog Box.

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS