Documentation Center

  • Trial Software
  • Product Updates

meta.EnumeratedValue

Describes enumeration members of MATLAB class

Description

The meta.EnumeratedValue class contains information about enumeration members defined by MATLAB® classes. The properties of a meta.EnumeratedValue object correspond the to attributes of the enumeration member being described.

All meta.EnumeratedValue properties are read-only. Query the meta.EnumeratedValue object to obtain information about the enumeration member it describes.

Obtain a meta.EnumeratedValue object from the EnumerationMemberList property of the meta.class object. EnumerationMemberList is an array of Meta.EnumeratedValue instances, one per enumeration member.

The meta.EnumeratedValue class is a subclass of the handle class.

Example

To access the meta.EnumeratedValue objects for a class, first create a meta.class object for that class. For example, give the following OnOff class definition:

classdef OnOff < logical
   enumeration
      On (true)
      Off (false)
   end
end

Obtain a meta.EnumeratedValue object from the EnumerationMemberList property of the meta.class object:

% Obtain the meta.class instance for the OnOff class
mc = ?OnOff;
% Get the array of EnumerateValue objects
enumList = mc.EnumerationMemberList; 
% Access the Name property of the first object in the array
enumList(1).Name =
ans =
On

Properties

PropertyPurpose
Name read onlyName of the enumeration member associated with this meta.EnumeratedValue object
Description read onlyThis property is not used
DetailedDescription read onlyThis property is not used

Methods

See the handle superclass for inherited methods.

Events

See the handle superclass for inherited events.

See Also

| | |

Was this topic helpful?