主要内容

Set Data Properties Basics

To control data names, sizes, data types, and initial values, configure the properties of data objects. These properties determine how your data objects behave during simulation.

For most Stateflow charts, you only need to configure a few key properties:

  • Name: Identifier used in chart actions and conditions

  • Scope: How the data operates in your chart (Input, Output, Local, Parameter)

  • Size: Number of elements (scalar, vector, or matrix)

  • Initial Value: Starting value for local and output data

Fo a full list of data properties you can update, see Set Data Properties.

Update Data Properties

Use the Property Inspector to update your data properties.

  1. In the Modeling tab, under Design Data, select Symbols Pane and Property Inspector.

  2. In the Symbols pane, select the data object.

  3. In the Property Inspector, edit the data properties.

The data name is the identifier for your data object. Choose names that clearly describe what the data represents. For example, use a name like engine_temp rather than x.

The scope determines where your data comes from and where it goes. Choose the scope based on how you want to use the data.

ScopeDescriptionUse
InputData flows from Simulink into your chartGetting sensor readings, user inputs, or data from other blocks
OutputData flows from your chart to SimulinkSending control signals, status information, or results
LocalData stays within your chartStoring intermediate calculations, counters, or flags
ConstantRead-only valueMathematical constants, configuration values, or thresholds
Parameter  
Temporary  

Size specifies how much data you have. Most data starts as a single value, but you can work with arrays or matrices when needed.