This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Fixed set of names representing a single type of value

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.


enumerationDisplay class enumeration members and names
isenumDetermine if variable is enumeration


meta.EnumeratedValueDescribe enumeration member of MATLAB class


Define and Use Enumerations

Named Values

Associate values with predefined names using constant properties or enumeration classes.

Define Enumeration Classes

Define enumeration classes by creating an enumeration block in the classdef file.

Refer to Enumerations

Refer to enumeration members using the class name and the member name.

Operations on Enumerations

Use logical, set membership, and string comparison operations on enumerations.

Enumeration Class Restrictions

Enumeration classes restrict certain aspects of their use and definition.

Mutable Handle vs. Immutable Value Enumeration Members

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.

Save and Load Enumerations

The type of enumeration class determines the information MATLAB® saves with the class.

Specialized Enumeration Classes

Enumerations Derived from Built-In Types

Enumeration classes derived from built-in types inherit behaviors from these types

Enumerations That Encapsulate Data

Define properties in an enumeration class to associate specific data with enumeration members.

Enumerations for Property Values

Use enumeration classes to restrict properties to a predefined set of values.

Related Information

Was this topic helpful?