meta.EnumeratedValue
描述枚举成员啊fMATLABclass
Description
Themeta.EnumeratedValue
class contains information about enumeration members defined by MATLAB®classes. The properties of ameta.EnumeratedValue
object correspond to the attributes of the enumeration member being described.
Allmeta.EnumeratedValue
properties are read-only. Query themeta.EnumeratedValue
object to obtain information about the enumeration member it describes.
Obtain ameta.EnumeratedValue
object from theEnumerationMemberList
property of themeta.class
object.EnumerationMemberList
is an array ofMeta.EnumeratedValue
instances, one per enumeration member.
Themeta.EnumeratedValue
class is a subclass of thehandle
class.
Example
To access themeta.EnumeratedValue
objects for a class, first create ameta.class
object for that class. For example, give the followingOnOff
class definition:
classdefOnOff < logicalenumerationOn (true) Off (false)endend
Obtain ameta.EnumeratedValue
object from theEnumerationMemberList
property of themeta.class
object:
% Obtain the meta.class instance for the OnOff classmc = ?OnOff;% Get the array of EnumerateValue objectsenumList = mc.EnumerationMemberList;% Access the Name property of the first object in the arrayenumList(1).Name = ans = On
Properties
Property | Purpose |
---|---|
Name read-only |
Name of the enumeration member associated with thismeta.EnumeratedValue object |
Description read-only |
This property holds the first comment line following an enumeration name inside an enumeration block. |
DetailedDescription read-only |
This property holds the comment lines immediately following an enumeration definition up to the first line that does not begin with a comment. The lines are in a 1-by-n MATLAB |
Methods
See thehandle
superclass for inherited methods.
Events
See thehandle
superclass for inherited events.