Main Content


Get default code settings for data category

Since R2021a



    value = getDataDefault(myCoderDictionaryObj, category, property) returns the value from the code mappings of the specified property for the specified data category.


    collapse all

    Use the coder.mapping.api.get function to access the CoderDictionary object associated with the data dictionary.

    cm = coder.mapping.api.get('codeDefinitions.sldd');

    To see the storage class of root-level inports for the dictionary, use the getDataDefault function.

    value = getDataDefault(cm, 'Inports', 'StorageClass')
    value =

    The dictionary uses the default storage class for inports.

    To configure the storage class, use the setDataDefault function.

    setDataDefault(cm, 'Inports', 'StorageClass', 'ExportedGlobal')

    To verify that the storage class of inports is now set to ExportedGlobal, use the getDataDefault function.

    value = getDataDefault(cm, 'Inports', 'StorageClass')
    value =

    Input Arguments

    collapse all

    Coder dictionary object returned by a call to function coder.mapping.api.get.

    Category of data elements to return a property value for.

    Example: 'Inports'

    Code mapping property that you return a value for. Specify one of these property names.

    Information to ReturnProperty Name
    Name of storage classStorageClass
    Name of variable for data element in the generated codeIdentifier
    Character vector or string scalar that names a memory section for a model defined in the Embedded Coder Dictionary.MemorySection

    Example: 'Identifier'

    Output Arguments

    collapse all

    The code mapping property value of the specified category, returned as a character vector.

    Version History

    Introduced in R2021a