Main Content

removeConstant

Remove constant from Architectural Data section of Simulink data dictionary

Since R2023b

    Description

    removeConstant(archDataObj,constantName) deletes the Simulink.dictionary.archdata.Constant object specified by constantName in the Architectural Data section of a data dictionary specified by archDataObj.

    example

    Examples

    collapse all

    To delete a specified constant from the data dictionary, use the removeConstant function. For an example that shows more of the workflow for related functions, see Create Architectural Data Object and Use It to Configure Architectural Data.

    Retrieve constants from the data dictionary.

    constNames = getConstantNames(archDataObj)
    constNames =
    
      1×2 cell array
    
        {'constToRemove'}    {'myConstant'}

    Remove a constant.

    removeConstant(archDataObj,"constToRemove")
    constNames = getConstantNames(archDataObj)
    constNames =
    
      1×1 cell array
    
        {'myConstant'}

    Input Arguments

    collapse all

    Architectural Data object, specified as a Simulink.dictionary.ArchitecturalData object.

    Name of constant in the Constants property array of archDataObj, specified as a character vector or string scalar.

    Example: "myConst"

    Version History

    Introduced in R2023b