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 Embedded MATLAB™ functions. 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. In the Stateflow Editor, select Tools > Explore.

    The Model Explorer appears.

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

  3. Select Add > Data, or click the Add Data button:

    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.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS