주요 콘텐츠

getDefaultConfiguration

(To be removed) Returns default variant configuration, if any, for a variant configuration data object

    getDefaultConfiguration will be removed in a future release. For more information, see Version History.

    Description

    configname = getDefaultConfiguration(varconfigdata) returns the default variant configuration for vcdataObj, a Simulink.VariantConfigurationData object. If no default variant configuration is defined, then [] is returned.

    Note

    Setting a default variant configuration for a variant configuration data object is not recommended. Activate and validate the model using a specific variant configuration instead. If you set a default configuration, compiling or simulating the model will apply the default configuration irrespective of the variant control variable values in the base workspace or data dictionary associated with the model.

    example

    Examples

    collapse all

    % Define the variant configuration data object
    vcdataObj = Simulink.VariantConfigurationData;
    
    % Add the variant configuration named LinInterExp
    addConfiguration(vcdataObj,'LinInterExp',...
      'Linear Internal Experimental Plant Controller');
    
    % Add the variant configuration LinInterStd
    addConfiguration(vcdataObj,'LinInterStd',...
      'Linear Internal Standard Plant Controller');
    
    % Set LinExtExp as the default variant configuration
    setDefaultConfigurationName(vcdataObj,'LinInterExp');
      
    % Obtain the default variant configuration
    defvc = getDefaultConfiguration(vcdataObj);

    Input Arguments

    collapse all

    Variant configuration data object for which you want to get the default configuration, specified as a Simulink.VariantConfigurationData object.

    Output Arguments

    collapse all

    Name of the default variant configuration, returned as a character vector or string.

    Data Types: char | string

    Version History

    Introduced in R2013b

    expand all