reduceModel
Class:Simulink.VariantManager
Package:万博1manbetx
Generate reduced model for specified variant configurations
Syntax
Simulink.VariantManager.reduceModel(Model)
Simulink.VariantManager.reduceModel(Model, Name, Value)
Description
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 withModel
)_r
.
Simulink.VariantManager.reduceModel(
specifies the reduction parameters in the Name and Value arguments form.Model
,Name, Value
)
Input Arguments
Examples
%控制variab减少模型基于它的变体le 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}); % Reduce the model by specifying the compilation mode as code generation. Simulink.VariantManager.reduceModel... ('slexVariantReducer','NamedConfigurations', {'config1'},'CompileMode','codegen','OutputFolder','L:\Models');