.NET Enumerations in MATLAB - MATLAB & Simulink (original) (raw)
Main Content
Create and combine .NET enumerations in MATLAB®
MATLAB allows you to work with .NET enumerations using features of the MATLAB enumeration class and some features unique to .NET.
Enumerations contain members, methods, and underlying values. Terms you should know:
- Enumeration — In MATLAB, a class having a finite set of named instances. In the following topics, the term
enumeration
refers to a .NET enumeration. - Enumeration member — Named instance of an enumeration class.
- Underlying value — Numeric value associated with an enumeration member.
Note
The MATLAB language supports user-defined enumeration classes. If you are using enumerations defined in MATLAB, refer to the topics under the creating MATLAB classes Enumerations category.
Functions
bitnot | .NET enumeration object bit-wise NOT instance method |
---|
Topics
- Pass System.Enum Arguments
Examples usingSystem.Enum
arguments. - NetDocEnum Example Assembly
Example source code. - Work with Members of a .NET Enumeration
This example uses theSystem.DayOfWeek
enumeration. - Refer to a .NET Enumeration Member
You use an enumeration member in your code as an instance of an enumeration. - Display .NET Enumeration Members as Character Vectors
To get the descriptive name of an enumeration, use thechar
method. - Convert .NET Enumeration Values to Type Double
How to convert a .NET enumeration values. - Iterate Through a .NET Enumeration
This example shows how to display member names of theSystem.DayOfWeek
enumeration. - Use .NET Enumerations to Test for Conditions
With relational operators, you can use enumeration members inif
andswitch
statements and other functions that test for equality. - Use Bit Flags with .NET Enumerations
This example shows how to combine members of an enumeration to create MATLAB variables. - Read Special System Folder Path
This example how to use the Microsoft®Environment.SpecialFolder
enum. - Default Methods for an Enumeration
By default, MATLAB provides relational operators, conversion methods, and bitwise methods for a .NET enumeration. - Underlying Enumeration Values
MATLAB supports enumerations of any numeric type.