getDataDefault - Get default code settings for data category - MATLAB (original) (raw)

Main Content

Get default code settings for data category

Since R2021a

Syntax

Description

[value](#mw%5F735d0301-967f-4763-8f06-69642ecf23c2) = getDataDefault([myCoderDictionaryObj](#mw%5Fa61f4cc7-c9f7-4d91-97f1-22bb7db16086), [category](#mw%5F9421b4a0-0427-45ce-8b85-43c7915823cf), [property](#mw%5F44f8d771-a442-4c2e-8984-d862e97f5b80)) returns the value from the code mappings of the specified property for the specified data category.

example

Examples

collapse all

Use the coder.mapping.api.get function to access theCoderDictionary 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 thegetDataDefault function.

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

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 toExportedGlobal, use the getDataDefault function.

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

Input Arguments

collapse all

Coder dictionary object returned by a call to functioncoder.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 or a property name for a storage class defined in the Embedded Coder Dictionary .

Information to Return Property Name
Name of storage class StorageClass
Name of variable for data element in the generated code Identifier
Name of source definition file that contains definitions for global data that is read by the data element and external code DefinitionFile
Name of get function called by code generated for the data element GetFunction
Name of source header file that contains declarations for global data that is read by the model data element and external code HeaderFile
Character vector or string scalar that names a memory section for a model defined in the Embedded Coder Dictionary. MemorySection
Name of model for which the code generator places the definition for data element shared by multiple models in a model hierarchy Owner
Boolean value indicating whether code generator preserves dimensions of data that is represented as a multidimensional array PerserveDimensions
Name of set function called by code generated for data element SetFunction
Name of structure in generated code for data element StructName

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