Main Content


Find enumeration classes defined by Simulink.defineIntEnumType



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


result = Simulink.findIntEnumType() returns meta.class objects for all enumeration classes that are defined by Simulink.defineIntEnumType. Use the returned meta.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 meta.class]}
        ContainingPackage: [0×0 meta.package]
     RestrictsSubclassing: 0
             PropertyList: [0×1]
               MethodList: [150×1 meta.method]
                EventList: [0×1 meta.event]
    EnumerationMemberList: [2×1 meta.EnumeratedValue]
           SuperclassList: [1×1 meta.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 meta.class objects. If there are no enumeration classes, the array is empty.

Version History

Introduced in R2018b