To minimize identifier length when referring to enumerated values
in Stateflow^{®} charts, you can use nonprefixed notation. This notation
is of the form * Name*, where

`Name`

If your chart uses data types that contain identical enumerated
names (such as `Colors.Red`

and `Temp.Red`

),
consider using prefixed notation to prevent name conflicts among identifiers.

The requirements for using nonprefixed notation are:

The enumerated data type definition must be in a file on the MATLAB

^{®}search path.Enumerated data of this type exists in the chart.

Suppose that you have an identifier with nonprefixed notation: `Red`

.
The enumerated name `Red`

belongs to the data type `TrafficColors`

.

To use the nonprefixed notation `Red`

, follow
these requirements:

Define

`TrafficColors`

as an enumerated data type in a file on the MATLAB search path.Define data of enumerated type

`TrafficColors`

in the chart.

To prevent name conflicts when referring to enumerated values
in charts, you can use prefixed notation. This notation is of the
form * Type*.

`Name`

`Type`

`Name`

Suppose that you have three data types (`Colors`

, `Temp`

,
and `Code`

) that contain the enumerated name `Red`

.
By using prefixed notation, you can distinguish `Colors.Red`

from `Temp.Red`

and `Code.Red`

.

The only requirement for using prefixed notation is that the enumerated data type definition is in a file on the MATLAB search path.

Suppose that you have an identifier with prefixed notation: `TrafficColors.Red`

.
The enumerated name `Red`

belongs to the data type `TrafficColors`

.

You can meet the requirement for prefixed notation by defining `TrafficColors`

as
an enumerated data type in a file on the MATLAB search path.

Was this topic helpful?