Simulink.VariantUtils.variantLegend - Display or control behavior of variant condition legend - MATLAB (original) (raw)

Main Content

Class: Simulink.VariantUtils
Namespace: Simulink

Display or control behavior of variant condition legend

Since R2023b

Syntax

Description

Simulink.VariantUtils.variantLegend([modelName](#d126e645208),[action](#d126e645229)) displays or performs a specified action on the variant condition legend.

example

Simulink.VariantUtils.variantLegend([modelName](#d126e645208),showCodeConditions=[codeConditionVisibility](#mw%5Feca59b28-d557-4d50-8fd5-78e029a391ff)) displays or hides the code generation condition column in the variant condition legend.

Input Arguments

expand all

Model for which the variant legend is displayed, specified as a character vector or a string.

Task to be performed on the variant condition legend for the model, specified as:

Display or hide code generation condition column in the Variant Conditions Legend dialog box, specified as on oroff. This column shows the variant condition in the generated code. The legend must be open for this setting to work.

Example: showCodeConditions='on'

Examples

expand all

Open the sldemo_variant_subsystems model.

model = 'slexVariantSubsystems'; open_system(model);

Display the variant condition legend for the model.

Simulink.VariantUtils.variantLegend(model,'open');

Display the code generation conditions column in the variant condition legend.

Simulink.VariantUtils.variantLegend(model,showCodeConditions='on');

Version History

Introduced in R2023b

expand all

The variantLegend method has been moved from theSimulink.VariantManager class to theSimulink.VariantUtils class.

See Also

Topics