Documentation Center

  • Trial Software
  • Product Updates

Notation for Enumerated Values in C Charts

Nonprefixed Notation for Enumerated Values

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.

Requirements for Using Nonprefixed Notation in C Charts

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.

Example of Nonprefixed Notation in C Charts

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.

Prefixed Notation for Enumerated Values

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.

Requirement for Using Prefixed Notation in C Charts

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.

Example of Prefixed Notation in C Charts

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?