getModelVariantControl - Get code configuration from code mappings for

    Simulink.VariantControl object - MATLAB ([original](https://www.mathworks.com/help/rtw/ref/getmodelvariantcontrol.html)) ([raw](?raw))

Main Content

Get code configuration from code mappings forSimulink.VariantControl object

Since R2025a

Syntax

Description

[propertyValue](#mw%5F53ba9629-5e34-4f3a-af89-a907118db31b) = getModelVariantControl([codeMappingObj](#mw%5F9c9a7921-f400-475d-b42f-2af6578855a1),[variantControl](#mw%5F20832c57-7539-4e30-9f0e-1c170ca2be5c),[property](#mw%5Fd0215c37-be1b-4f2a-9156-35da6323af04)) returns the value of a code mapping property or calibration property for the specifiedSimulink.VariantControl object. Use this function to return the storage class or the calibration access of a calibration property configured for the variant control. Specifying code generation attributes for a Simulink.VariantControl object using code mappings is supported when the object is defined in the model workspace and itsValue property is set to a Simulink.Parameter object.

example

Examples

collapse all

From the model code mappings for the modelslexVariantParameterCodeMappings, get the name of the storage class of variant control Wiper.

openExample("simulinkcoder/ConfigureCodeGenForVariantParametersInModelWorkspaceExample"); cm = coder.mapping.api.get("slexVariantParameterCodeMappings"); getModelVariantControl(cm,"Wiper","StorageClass");

Input Arguments

collapse all

Name of Simulink.VariantControl object specified as a character vector or string scalar.

Example: "varCtrl"

Data Types: char | string

Code mapping property name. The getModelVariantControl function returns the value of this property. 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 variant control in the generated code Identifier
Boolean value indicating whether to export the selected variant control to an A2L calibration file Export
Mask value in hexadecimal format to extract single bits from the variant control in a calibration tool BitMask
Enumeration value indicating the access of calibration:Calibration for a variant control indicates that the variant control can be calibrated and is the default value for the property.NoCalibration indicates that the variant control can be read-only and cannot be calibrated. CalibrationAccess
Name of the conversion method used during the calibration CompuMethod
Optional display name of the variant control for calibration DisplayIdentifier
Display format of the variant control being calibrated in a calibration tool Format

Example: "StorageClass"

Output Arguments

collapse all

Name of the storage class or value of the specified storage class property configured for the variant control, returned as a character vector.

Version History

Introduced in R2025a