Class: Simulink.VariantManager
Package: Simulink
Generate reduced model for specified variant configurations
Simulink.VariantManager.reduceModel(Model)
Simulink.VariantManager.reduceModel(Model, Name, Value)
Simulink.VariantManager.reduceModel(
creates a reduced model for the specified configuration. The referenced models and
library blocks are also reduced. By default, the name of the reduced model and any
reduced child referenced model name is the original model name suffixed with
Model
)_r
.
Simulink.VariantManager.reduceModel(
specifies the reduction parameters in the Name and Value arguments form.Model
, Name, Value
)
% Reduce model based on its variant control variable values in the base workspace. Simulink.VariantManager.reduceModel('sldemo_variant_subsystems'); % Reduce the model associated with a variant configuration data object and configurations to be retained in the reduced model. Simulink.VariantManager.reduceModel('slexVariantManagement', ... 'NamedConfigurations', {'LinInterStd', 'NonLinExterHighFid'}) % Reduce the model by specifying variant control variable values. Here, two groups are specified corresponding to % {V==1, W==1}, and {V==2, W==2} respectively. Simulink.VariantManager.reduceModel('iv_model', ... 'VariableGroups',... {{'V',1,'W',1},{'V',2,'W',2}}); % Reduce the model by specifying variant control variable values where 'W' is a full-range variant control variable and 'V' is 1. Here, Variant Reducer % automatically maps the specification to correspond to the following four explicit groups: {V==1, W==1}, {V==1, W==2}, {V==1, W==3} and {V==1, W==0} respectively. Simulink.VariantManager.reduceModel('slexVariantReducer',... 'VariableGroups',... {'V',1},... 'FullRangeVariables',{'W',1});