setDataDefault
Description
setDataDefault(
sets the default storage class and storage class property values in the code mappings for
the specified category of model data.myCoderDictionaryObj
,category
,Name,Value
)
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
ExternalParameterObjects
| GlobalDataStores
| Inports
| InternalData
| ModelParameters
| Outports
| SharedLocalDataStores
Category of data elements to return a property value for.
Example: 'Inports'
Name-Value Arguments
Example: 'StorageClass','ExportedGlobal'
Specify comma-separated pairs of Name,Value
arguments.
Name
is the argument name and Value
is the
corresponding value. Name
must appear inside quotes. You can specify
several name and value pair arguments as Name1,Value1,…,NameN,ValueN
. The
order of the name and value pair arguments does not matter.
StorageClass
— Name of storage class
Auto
| Dictionary default
| ExportedGlobal
| ImportedExtern
| ImportedExternPointer
| Model default
Storage class to set for the specified data element category. The name of a predefined storage class or storage class that is defined in the Embedded Coder Dictionary associated with the model. Values that you can specify vary depending on the category that you specify. See Choose Storage Class for Controlling Data Representation in Generated Code.
Example: 'StorageClass','ImportedExtern'
Version History
Introduced in R2021a
See Also
coder.mapping.api.CoderDictionary
| getDataDefault
| setFunctionDefault
(Embedded Coder) | getFunctionDefault
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
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)