Main Content


Find enumeration classes defined by Simulink.defineIntEnumType



result = Simulink.findIntEnumType(typeName) returns the matlab.metadata.Class object for class type that is defined by Simulink.defineIntEnumType. Use the returned matlab.metadata.Class object to query attributes of the enumeration class. If the class does not exist, the function returns an empty matlab.metadata.Class object.


result = Simulink.findIntEnumType() returns matlab.metadata.Class objects for all enumeration classes that are defined by Simulink.defineIntEnumType. Use the returned matlab.metadata.Class objects to query attributes of the enumeration classes.


collapse all

Define an enumeration type.

Simulink.defineIntEnumType('myEnumType', {'e1', 'e2'}, [1 2]);

Check for the enumeration type that you have created.

myResult = Simulink.findIntEnumType('myEnumType')
myResult = 

  class with properties:

                     Name: 'myEnumType'
              Description: ''
      DetailedDescription: ''
                   Hidden: 0
                   Sealed: 0
                 Abstract: 0
              Enumeration: 1
          ConstructOnLoad: 0
         HandleCompatible: 0
          InferiorClasses: {[1×1 matlab.metadata.Class]}
                Namespace: [0×0 matlab.metadata.Namespace]
     RestrictsSubclassing: 0
             PropertyList: [0×1 matlab.metadata.Property]
               MethodList: [150×1 matlab.metadata.Method]
                EventList: [0×1 matlab.metadata.Event]
    EnumerationMemberList: [2×1 matlab.metadata.EnumerationMember]
           SuperclassList: [1×1 matlab.metadata.Class]

Define two enumeration types.

Simulink.defineIntEnumType('myEnumType1', {'e1', 'e2'}, [1 2]);​
Simulink.defineIntEnumType('myEnumType2', {'e3', 'e4'}, [3 4]);

Check for the enumeration types that you have created.

myResult = Simulink.findIntEnumType()

Input Arguments

collapse all

Name of a specific enumeration class that is defined by Simulink.defineIntEnumType, specified as a character vector or string.

Example: 'myEnumType'

Data Types: char | string

Output Arguments

collapse all

Search result, returned as an array of matlab.metadata.Class objects. If there are no enumeration classes, the array is empty.

Version History

Introduced in R2018b