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.

Default Methods for an Enumeration

By default, MATLAB® provides the following methods for a .NET enumeration:

  • Relational operators — eq, ne, ge, gt, le, and lt.

  • Conversion methods — char, double, and a method to get the underlying value.

  • Bit-wise methods — Only for enumerations with the System.Flags attribute.

For example, type:

Methods for class System.DayOfWeek:

CompareTo    eq
DayOfWeek    ge
Equals       gt
GetHashCode  int32
GetType      le
GetTypeCode  lt
ToString     ne

The method to get the underlying value is int32.

The NetDocEnum.MyDays enumeration, which has the Flags attribute, has the bit-wise methods. To list the methods, type:

Methods for class NetDocEnum.MyDays:

CompareTo    char         
Equals       double       
GetHashCode  eq           
GetType      ge           
GetTypeCode  gt           
MyDays       int32        
ToString     le           
bitand       lt           
bitnot       ne           

Related Examples

More About

Was this topic helpful?