Enumerazioni .NET in MATLAB
MATLAB consente di lavorare con le enumerazioni .NET utilizzando le feature della classe di enumerazione di MATLAB e alcune feature esclusive di .NET.
Le enumerazioni contengono membri, metodi e valori sottostanti. I termini da conoscere sono i seguenti:
Enumerazione: in MATLAB, una classe che ha un insieme finito di istanze nominate. Nei seguenti argomenti, il termine
enumerationsi riferisce a un'enumerazione .NET.Membro di enumerazione: istanza denominata di una classe di enumerazione.
Valore sottostante: valore numerico associato a un membro dell'enumerazione.
Nota
Il linguaggio MATLAB supporta classi di enumerazione definite dall'utente. Se si utilizzano enumerazioni definite in MATLAB, fare riferimento agli argomenti della categoria di creazione classi di MATLAB Enumerazioni.
Funzioni
bitnot | .NET enumeration object bit-wise NOT instance method |
Argomenti
- Pass System.Enum Arguments
Examples using
System.Enumarguments. - NetDocEnum Example Assembly
Example source code.
- Work with Members of a .NET Enumeration
This example uses the
System.DayOfWeekenumeration. - 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 the
charmethod. - 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 the
System.DayOfWeekenumeration. - Use .NET Enumerations to Test for Conditions
With relational operators, you can use enumeration members in
ifandswitchstatements 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.SpecialFolderenum. - 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.
Risoluzione dei problemi
Limitations to Support of .NET Enumerations
.NET features not supported in MATLAB.