Main Content

getConstant

Get Simulink.dictionary.archdata.Constant object in Architectural Data section of Simulink data dictionary

Since R2023b

    Description

    constObj = getConstant(archDataObj,constName) returns the Simulink.dictionary.archdata.Constant object specified by constName in the Architectural Data section of a data dictionary specified by archDataObj.

    example

    Examples

    collapse all

    To get the Simulink.dictionary.archdata.Constant object that represents a constant in a data dictionary, use the getConstant function. For more examples of architectural data management workflows and related functions, see Store Data in Architectural Data Section Programmatically.

    myConstObj = getConstant(archDataObj,"numOfCylinders")
    myConstObj = 
    
      Constant with properties:
    
               Name: 'numOfCylinders'
              Value: 4
           DataType: 'double'
        Description: ''
              Owner: [1×1 Simulink.dictionary.ArchitecturalData]

    Input Arguments

    collapse all

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

    Simulink.dictionary.archdata.Constant definition name in Constants property array of archDataObj, specified as a character vector or string scalar.

    Example: "numOfCylinders"

    Output Arguments

    collapse all

    Object representing a constant in the Constants property array of archDataObj, returned as a Simulink.dictionary.archdata.Constant object.

    Version History

    Introduced in R2023b