Main Content

getConstantNames

Get constant names in Architectural Data section of Simulink data dictionary

Since R2023b

    Description

    constantNames = getConstantNames(archDataObj) returns a cell array of the Simulink.dictionary.archdata.Constant objects in the Architectural Data section of the top data dictionary specified by archDataObj, and in referenced data dictionaries.

    example

    constantNames = getConstantNames(archDataObj,LookInsideDictReferences=tf) returns a cell array of the Simulink.dictionary.archdata.Constant objects in the Architectural Data section of the top data dictionary only, or in the top data dictionary and in referenced data dictionaries.

    example

    Examples

    collapse all

    To get a cell array of the constant names in a data dictionary, use the getConstantNames 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.

    constantNames = getConstantNames(archDataObj)
    constantNames =
    
      1×2 cell array
    
        {'myConstant'}    {'numOfCylinders'}

    Input Arguments

    collapse all

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

    Flag to list constants in referenced data dictionaries in the returned cell array, specified as one of these values:

    • true — Constants in the referenced data dictionaries will be included in the returned cell array.

    • false — Constants in the referenced data dictionaries will not be included in the returned cell array.

    Example: true

    Output Arguments

    collapse all

    Constant names in the Constants property array of archDataObj, returned as a cell array of character vectors.

    Version History

    Introduced in R2023b