getDataDefault
Description
returns the value from the code mappings of the specified property for the specified data
category.value
= getDataDefault(myCoderDictionaryObj
, category
, property
)
Examples
Configure default code settings for a data category in a data dictionary
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 = 'Default'
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 = 'ExportedGlobal'
Input Arguments
myCoderDictionaryObj
— Coder dictionary object
CoderDictionary
object
Coder dictionary object returned by a call to function
coder.mapping.api.get
.
category
— Model data element category
Constants
| ExternalParameterObjects
| GlobalDataStores
| Inports
| InternalData
| ModelParameters
| ModelParameterArguments
| Outports
| SharedLocalDataStores
Category of data elements to return a property value for.
Example: 'Inports'
property
— Code mapping property value to return
StorageClass
| Identifier
| DefinitionFile
| GetFunction
| HeaderFile
| MemorySection
| Owner
| PreserveDimensions
| SetFunction
| StructName
| storage class property name
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
value
— Code mapping property value of category
character vector
The code mapping property value of the specified category, returned as a character vector.
Version History
Introduced in R2021a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)