Use enumerations to represent a fixed set of named values, where all the values are of the same kind. You can derive enumeration classes from other classes, such as built-in numeric types. The enumeration members then inherit arithmetic and ordering operations of the superclass.
|Describe enumeration member of MATLAB class|
Define and Use Enumerations
Associate values with predefined names using constant properties or enumeration classes.
Define enumeration classes by creating an enumeration block in the
Refer to enumeration members using the class name and the member name.
Use logical, set membership, and string comparison operations on enumerations.
Enumeration classes restrict certain aspects of their use and definition.
Use a handle enumeration to enumerate a set of objects whose state can change over time. Use a value enumeration to enumerate a set of abstract (and immutable) values.
The type of enumeration class determines the information MATLAB® saves with the class.
Hiding enumeration members enables you to replace enumeration names without creating incompatibilities.
Specialized Enumeration Classes
Enumeration classes derived from built-in types inherit behaviors from these types.
Define properties in an enumeration class to associate specific data with enumeration members.
Use enumeration classes to restrict properties to a predefined set of values.