Main Content

removeEnumeral

Remove enumeration member from enumerated data type definition in Architectural Data section of data dictionary

Since R2023b

    Description

    removeEnumeral(enumType,enumMemberName) removes the enumeration member with name enumMemberName from the enumerated data type definition specified by enumType.

    example

    removeEnumeral(enumType,enumMemberIndex) removes the enumeration member with index enumMemberIndex from the enumerated data type definition specified by enumType.

    example

    Examples

    collapse all

    Create a Simulink.dictionary.ArchitecturalData object to retrieve the contents of the Architectural Data section of a data dictionary. Use the getDataType function to get the enumerated data type definition. This example uses a previously created data dictionary myArchtecturalData.sldd with an enumerated type named MyAnimals.

    archdata = Simulink.dictionary.archdata.create("myArchitecturalData.sldd");
    MyAnimals = getDataType(archdata,"animalsRanked");
    names = getEnumeralNames(MyAnimals)'
    names =
    
      7×1 cell array
    
        {'enum1' }
        {'Ibex'  }
        {'Deer'  }
        {'Wolf'  }
        {'Turtle'}
        {'Cat'   }
        {'Dog'   }

    Remove enumeration member enum1.

    removeEnumeral(MyAnimals,"enum1");
    getEnumeralNames(MyAnimals)
    ans =
    
      6×1 cell array
    
        {'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.

    Index of enumeration member in the enumerated data type enumType, specified as an integer.

    Example: getEnumeral(enumType,4)

    Name of enumeration member in the enumerated data type defined by enumType, specified as a character vector or string scalar.

    Example: removeEnumeral(enumType,"Square")

    Data Types: char | string

    Version History

    Introduced in R2023b