Documentation Center

  • Trial Software
  • Product Updates

Define Temporary Data

When to Define Temporary Data

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.

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 Set Data Properties.

Was this topic helpful?