getModelParameter
Get code and calibration configuration from code mappings for model parameters
Since R2020b
Description
returns the value of a code mapping property or calibration property for the specified model
workspace parameter or model parameter argument. For
example, use this function to return the storage class or the calibration access of a
calibration property configured for the parameter or parameter
argument.propertyValue
= getModelParameter(myCodeMappingObj
,modelParameter
,property
)
Examples
Get Storage Class Configured for Model Parameter
From the model code mappings for model
ConfigurationRapidPrototypingInterface
, get the name of the storage
class that is configured for model parameter K1
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); scK1 = getModelParameter(cm,"K1","StorageClass");
Get Identifier Configured for Model Parameter
From the model code mappings for model
ConfigurationRapidPrototypingInterface
, configure the storage class
and identifier for model parameter Table1
. To access the identifier
configured for a model parameter, use the getModelParameter
function.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); setModelParameter(cm,"Table1",StorageClass="ExportedGlobal",Identifier="mp_Table1") idTable1 = getModelParameter(cm,"Table1","Identifier")
idTable1 = 'mp_Table1'
Get Storage Class Configured for Model Parameter Arguments
From the model code mappings for model
ConfigurationRapidPrototypingInterface
, get the storage class
configured for model parameter arguments LOWER
and
UPPER
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); scLOWER = getModelParameter(cm,"LOWER","StorageClass"); scUPPER = getModelParameter(cm,"UPPER","StorageClass");
Get Calibration Properties Configured for Model Parameter
From the model code mappings for model
ConfigurationRapidPrototypingInterface
, get the calibration
properties such as calibration access and display identifier configured for model
parameter LOWER
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); prop_export = getModelParameter(cm,"LOWER","Export"); prop_bitmask = getModelParameter(cm,"LOWER","BitMask"); prop_calaccess = getModelParameter(cm,"LOWER","CalibrationAccess"); prop_compname = getModelParameter(cm,"LOWER","CompuMethod"); prop_dispid = getModelParameter(cm,"LOWER","DisplayIdentifier"); prop_format = getModelParameter(cm,"LOWER","Format");
Input Arguments
myCodeMappingObj
— Code mapping object
CodeMapping
object
Code mapping object (model code mappings) returned by a call to function
coder.mapping.api.get
.
Example: myCM
modelParameter
— Name of model parameter or model parameter argument
character vector | string scalar
Name of the model workspace parameter or model parameter argument for which to return the code mapping information.
Example: "Table1"
Data Types: char
| string
property
— Code mapping property value to return
StorageClass
| Identifier
| DefinitionFile
| GetFunction
| HeaderFile
| Owner
| PreserveDimensions
| SetFunction
| StructName
| storage class property name | Export
| BitMask
| CalibrationAccess
| CompuMethod
| DisplayIdentifier
| Format
| ParameterTuningService
| ParameterArgumentTuningService
Code mapping property for which to return a value. For a storage class defined in the Embedded Coder Dictionary associated with the model, specify a property name or one of these property names.
Information to Return | Property Name |
---|---|
Name of storage class | StorageClass |
Name of variable for the parameter or parameter argument in the generated code | Identifier |
Name of source definition file that contains definitions for global data that is read by the parameter or parameter argument and external code | DefinitionFile |
Name of get function called by code generated for the
parameter or parameter argument
| GetFunction |
Name of source header file that contains declarations for global data that is read by the parameter or parameter argument and external code | HeaderFile |
Name of model for which the code generator places the definition for the parameter or parameter argument shared by multiple models in a model hierarchy | Owner |
Boolean value indicating whether the code generator preserves dimensions of a parameter or parameter argument that is represented as a multidimensional array | PerserveDimensions |
Name of set function called by code generated for the
parameter or parameter argument | SetFunction |
Name of structure in generated code for the parameter or parameter argument | StructName |
Boolean value indicating whether to export the selected model parameter to a calibration file (a2l) | Export |
Mask value in hexadecimal format to extract single bits from the model parameter in a calibration tool | BitMask |
Enumeration value indicating the access of calibration.
Calibration for an parameter indicates that the parameter
can be calibrated and is the default value for the property.
NoCalibration indicates that the parameter can be read-only
and cannot be calibrated. | CalibrationAccess |
Name of the conversion method used during the calibration | CompuMethod |
Optional display name of the model parameter for calibration | DisplayIdentifier |
Specifies the display format of the model parameter being calibrated in a calibration tool | Format |
Name of parameter argument tuning service defined in Embedded Coder Dictionary | ParameterArgumentTuningService |
Name of parameter tuning service defined in Embedded Coder Dictionary | ParameterTuningService |
Example: "StorageClass"
Example: "CalibrationAccess"
Output Arguments
propertyValue
— Name of storage class or value of storage class property
character vector
Name of the storage class or value of the specified storage class property configured for model parameter or parameter argument .
Data Types: char
Version History
Introduced in R2020b
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de 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)