Main Content

detachConfigSet

Dissociate configuration set or configuration reference from model

Description

configObj = detachConfigSet(model, configObjName) dissociates the configuration set or configuration reference with the name configObjName from the model. The function returns the detached configuration as a Simulink.ConfigSet object or a Simulink.ConfigSetRef object. You cannot detach the active configuration from a model. When you want to detach the active configuration, first activate a different configuration for the model.

example

Examples

collapse all

Create, attach, and activate a configuration set for a model. Then, detach the default configuration set from the model.

Open the Model Fault-Tolerant Fuel Control System example model sldemo_fuelsys. Create a configuration set named 'MyConfig' and attach it to the model.

openExample('simulink_automotive/ModelingAFaultTolerantFuelControlSystemExample')
sldemo_fuelsys
configObj = Simulink.ConfigSet;
set_param(configObj,'Name','MyConfig')
attachConfigSet('sldemo_fuelsys',configObj)

The active configuration for sldemo_fuelsys is the default configuration set, Configuration. To detach Configuration, activate another configuration for the model. For this example, set MyConfig as the active configuration set for sldemo_fuelsys.

setActiveConfigSet('sldemo_fuelsys','MyConfig')

Detach the default configuration set Configuration from the model.

detachConfigSet('sldemo_fuelsys','Configuration');

Input Arguments

collapse all

Model from which to disassociate a configuration set, specified as a character vector or string scalar. The model must be open.

Example: 'my_model'

Name of the configuration object to detach from the model, specified as a character vector or string scalar.

Example: 'Configuration'

Version History

Introduced in R2006a