Documentation |
On this page… |
---|
To minimize identifier length when referring to enumerated values in C charts, you can use nonprefixed notation. This notation is a string of the form Name.Name is the enumerated value name.
If your C 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. For details, see Prefixed Notation for Enumerated Values.
The requirements for using nonprefixed notation in C charts are:
The enumerated data type definition must be in a file on the MATLAB^{®} search path.
One of the following is true:
Enumerated data of this type exists in the chart. For more information, see Define Enumerated Data in a Chart.
A full prefixed notation for this enumerated data type is used somewhere in a state or transition in the chart.
Suppose that you have an identifier with nonprefixed notation: Red. The enumerated name Red belongs to the data type TrafficColors.
To meet the requirements for nonprefixed notation:
Define TrafficColors as an enumerated data type in a file on the MATLAB search path.
Verify that one of the following is true:
Enumerated data of this type exists in the chart.
A prefixed notation for this enumerated data type, such as TrafficColors.Yellow or TrafficColors.Green is used somewhere in a state or transition of the chart.
To prevent name conflicts when referring to enumerated values in C charts, you can use prefixed notation. This notation is a string of the form Type.Name. Type is an enumerated data type and Name is the enumerated value 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 in C charts 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.