Main Content

getEnumeralNames

Get names of enumeration members present in enumerated data type in Architectural Data section of data dictionary

Since R2025a

    Description

    memberNames = getEnumeralNames(enumType) returns the enumeration member names present in the enumerated data type specified by enumType.

    example

    Examples

    collapse all

    This example shows how to retrieve the names of all enumeration members owned by an enumerated data type that is stored in the Architectural Data section of a data dictionary use the getEnumeralNames function.

    Add an enumerated data type with enumeration members to the Architectural Data section of a data dictionary.

    dictName = "myArchitecturalData.sldd";
    archData = Simulink.dictionary.archdata.create(dictName);
    MyAnimals = addEnumType(archData,"animalsRanked");
    addEnumeral(MyAnimals,"Ibex",'6',"Not actually a deer.");
    addEnumeral(MyAnimals,"Deer",'5',"Actually a deer.");
    addEnumeral(MyAnimals,"Wolf",'4',"Hunts deer.");
    addEnumeral(MyAnimals,"Turtle",'3',"Sometimes friendly, mostly slow.");
    addEnumeral(MyAnimals,"Cat",'2',"Cute and fluffy.");
    addEnumeral(MyAnimals,"Dog",'1',"Faithful companion.");

    Get the names of the enumeration members by using the getEnumeralNames function.

    animalNames = getEnumeralNames(MyAnimals)'
    animalNames =
    
      8×1 cell array
    
        {'enum1'    }
        {'Ibex'    }
        {'Deer'    }
        {'Wolf'    }
        {'Turtle'  }
        {'Cat'     }
        {'Dog'     }      
    

    Input Arguments

    collapse all

    Enumerated data type stored in the Architectural Data section of a data dictionary, specified by a Simulink.dictionary.archdata.EnumType object.

    Output Arguments

    collapse all

    Names of the enumeration members in enumType, returned as a cell array of character vectors.

    Data Types: cell

    Version History

    Introduced in R2025a