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.
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
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:
'open'
— Display the variant condition legend for a model. The model must be open. If the legend is opened for the first time, the model is updated.'print'
— Print the data in the variant condition legend. The legend must be open. There is no preview before printing the legend.'close'
— Close the variant condition legend belonging to the specified model.
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
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
The variantLegend
method has been moved from theSimulink.VariantManager
class to theSimulink.VariantUtils
class.