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.
In the Modeling tab, under Design Data, select Symbols Pane and Property Inspector.
In the Symbols pane, select the data object.
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.
| Scope | Description | Use |
|---|---|---|
| Input | Data flows from Simulink into your chart | Getting sensor readings, user inputs, or data from other blocks |
| Output | Data flows from your chart to Simulink | Sending control signals, status information, or results |
| Local | Data stays within your chart | Storing intermediate calculations, counters, or flags |
| Constant | Read-only value | Mathematical 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.