Main Content


Get constant in Architectural Data section of Simulink data dictionary

Since R2023b



    constObj = getConstant(archDataObj,constName) returns the constant object in archDataObj, the Architectural Data section of a data dictionary, that represents the constant specified by constName.


    collapse all

    To get the constant object that represents a constant in a data dictionary, use the getConstant 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.

    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.

    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