| Contents | Index |
enumeration ClassName
enumeration(obj)
m = enumeration(ClassName)
m = enumeration(obj)
[m,s] = enumeration(ClassName)
[m,s] = enumeration(obj)
enumeration ClassName displays the names of the enumeration members for the MATLAB class with the name ClassName.
enumeration(obj) displays the names of the enumeration members for the class of obj.
m = enumeration(ClassName) returns the enumeration members for the class in the column vector m of objects.
m = enumeration(obj) returns the enumeration members for the class of object, obj, in the column vector m of objects.
[m,s] = enumeration(ClassName) returns the names of the enumeration members in the cell array of strings s. The names in s correspond element-wise to the enumeration members in m.
[m,s] = enumeration(obj) returns the enumeration members for the class of object, obj, in the column vector m of objects.
An enumeration class that derives from a built-in class can specify more than one name for a given enumeration member.
When you call the enumeration function with no output arguments, MATLAB displays only the first name for each enumeration member (as specified in the class definition). To see all available enumeration members and their names, use the two output arguments (for example, [m, s] = enumeration(obj);).
ClassName |
The name of the enumeration class, in single quotes. |
obj |
A instance of an enumeration class. |
m |
Column vector of enumeration members. |
s |
Cell array of strings containing the enumeration names. |
All examples use the following enumeration class.
classdef Boolean < logical enumeration No (0) Yes (1) Off (0) On (1) end end
Display the names of the enumeration members for class Boolean:
enumeration Boolean
Enumerations for class Boolean:
No
YesGet the enumeration members for class Boolean in a column vector of objects:
members = enumeration('Boolean')
members =
No
YesGet all available enumeration members and their names:
[members, names] = enumeration('Boolean')
members =
No
Yes
No
Yes
names =
'No'
'Yes'
'off'
'on'

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |