getModelParameter - Get code and calibration configuration from code mappings for model
parameters - MATLAB ([original](https://in.mathworks.com/help/rtw/ref/getmodelparameter.html)) ([raw](?raw))
Get code and calibration configuration from code mappings for model parameters
Since R2020b
Syntax
Description
[propertyValue](#mw%5F0d2c0589-ed89-4238-a0ea-99dcf4f870c4) = getModelParameter([myCodeMappingObj](#mw%5F367d81b3-48c2-4294-aecb-3a76c6a4e412),[modelParameter](#mw%5F70b81fd7-615f-41c4-b24a-2befd6fb180e),[property](#mw%5F746026a7-eb6e-4628-a9c7-6be9bf568e36))
returns the value of a code mapping property or calibration property for the specified model workspace parameter. For example, use this function to return the storage class or the calibration access of a calibration property configured for the parameter.
Examples
From the model code mappings for modelConfigurationRapidPrototypingInterface
, 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");
From the model code mappings for modelConfigurationRapidPrototypingInterface
, 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")
From the model code mappings for modelConfigurationRapidPrototypingInterface
, 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
Code mapping object (model code mappings) returned by a call to functioncoder.mapping.api.get
.
Example: myCM
Name of the model workspace parameter for which to return the code mapping information.
Example: "Table1"
Data Types: char
| string
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 in the generated code | Identifier |
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 |
Example: "StorageClass"
Example: "CalibrationAccess"
Output Arguments
Name of the storage class or value of the specified storage class property configured for model parameter.
Data Types: char
Version History
Introduced in R2020b