| Contents | Index |
| On this page… |
|---|
Dot notation is a way to identify data at a specific level of the Stateflow chart hierarchy. For example, you can use dot notation for data identifiers in state actions and transitions.

In this chart, data resides in the state aa. Identifiers in state actions and transitions use dot notation to refer to this data.
In state a, the entry action contains the identifier aa.data.
In state b, the entry action contains the identifier a.aa.data.
In the default transition, the action contains the identifier a.aa.data.
During simulation, the chart searches for data that matches the identifier with dot notation. These rules apply:
The chart does not do an exhaustive search of all data.
The chart does not stop searching after finding one match. The search continues until it reaches the chart level.
Process for Resolving Data Identifiers with Dot Notation

The flow chart describes the following search process.
| Stage | Action |
|---|---|
| 1 | The search begins at the level of the hierarchy where the identifier appears.
|
| 2 | The chart searches at that level of the hierarchy for a path to the data. If the chart finds a match, it adds that path to the list of possible matches. |
| 3 | The chart moves up to the next highest level of the hierarchy. At that level, the chart searches for a path to the data. If the chart finds a match, it adds that path to the list of possible matches. |
| 4 | The previous step repeats until the search reaches the chart level. |
| 5 | At the chart level, one more search occurs for a path to the data. If a match exists, that path becomes part of the list of possible matches. Then, the search ends. |
| 6 | After the search ends, one of the following occurs:
|
These examples show how to avoid problems when using dot notation in data identifiers.
Be specific when defining the path to the data.

Suppose that state aa contains data. In state b, the entry action contains the aa.data identifier that the chart cannot resolve. This search process occurs:
| Stage | Action | Finds a Match? |
|---|---|---|
| 1 | Chooses state b as the starting point and searches at that level for an object aa that contains data. | No |
| 2 | Moves up to the next level of the hierarchy and searches at the chart level for an object aa that contains data. | No |
The search ends, and an error message appears because no match exists for the aa.data identifier.
To avoid this message, use a specific path in the identifier for the entry action in state b:
en: a.aa.data+=1;
Use unique names when you name the states in a chart.

Suppose that both states named aa contain a data object named data. In state a, the entry action contains two aa.data identifiers that the chart cannot resolve. This search process occurs:
| Stage | Action | Finds a Match? |
|---|---|---|
| 1 | Chooses state a as the starting point and searches at that level for an object aa that contains data. | Yes |
| 2 | Moves up to the next level of the hierarchy and searches at the chart level for an object aa that contains data. | Yes |
The search ends, and a warning message appears because multiple matches of equal priority exist for the aa.data identifiers.
To avoid this message, perform one of these corrective actions:
Rename one of the two states named aa.
Use a more specific path in the identifiers for the entry action in state a:
en: y+=a.aa.data, a.aa.data+=1;
Enclose the outer state aa in a box or another state. Adding an enclosure prevents the search process from detecting that outer state.

![]() | Defining Temporary Data | Resolving Data Properties from Simulink Signal Objects | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |