主要内容

removeControlVariable

Remove variant control variable from variant configuration

    Description

    Add-On Required: This feature requires the Variant Manager for Simulink add-on.

    removeControlVariable(varConfigData,ConfigurationName=configName,ControlVariableName=ctrlVarName) removes the variant control variable named ctrlVarName from the configuration configName present in the Simulink.VariantConfigurationData object varConfigData.

    example

    removeControlVariable(___,ControlVariableSource=ctrlVarSource) allows you to specify the name of the data source where the control variable is defined in addition to the input arguments in the previous syntax. Use this syntax if multiple control variables with the same name exist in different sources.

    Examples

    collapse all

    Open the slexVariantReducer model.

    modelName="slexVariantReducer";
    open_system(modelName);

    Remove the control variable W from the variant configuration config1.

    varConfigData = Simulink.VariantManager.getConfigurationData(modelName);
    removeControlVariable(varConfigData,ConfigurationName="config1",ControlVariableName="W");

    Input Arguments

    collapse all

    Variant configuration data that contains the configuration from which you want to remove the control variable, specified as a Simulink.VariantConfigurationData object.

    Name of the variant configuration from which the control variable is removed, specified as a character vector or string scalar. The configuration must be defined in varConfigData.

    Example: "LinInterExpNoNoise"

    Data Types: char | string

    Name of the control variable to be removed from the variant configuration, specified as a character vector or string scalar.

    Example: "PlantLoc"

    Data Types: char | string

    Data source of the control variable, specified as a character vector or string scalar.

    Example: "topData.sldd"

    Example: "base workspace"

    Version History

    Introduced in R2013b

    expand all