Main Content

Simulink.ConfigSetRef

Link model to freestanding configuration set

Description

Use the ConfigSetRef object to allow a model to reference configuration sets that are not saved in a model.

Creation

Create a ConfigSetRef object by using the getConfigSet function to call a model configuration reference by name.

Properties

expand all

Description of the configuration reference, specified as a character vector. Use this property to provide additional information about a configuration reference, such as its purpose. This field can remain blank.

Name of the configuration reference, specified as a character vector. This name represents the configuration reference in the Model Explorer.

Name of the variable in the workspace or the data dictionary that contains the referenced configuration set, specified as a character vector.

Object Functions

copyCopy configuration set or reference
get_paramGet parameter names and values

Examples

collapse all

Use a ConfigSetRef object to allow a model to use a freestanding configuration set, which is not associated with a model.

Open the model vdp. Create a freestanding configuration set by copying the configuration set of the model.

model = 'vdp';
open_system(model)

freeConfigSet = copy(getActiveConfigSet(model));

Create a configuration reference. To point the reference to your freestanding configuration, set the SourceName property to freeConfigSet, the base workspace variable that represents your configuration. Name the reference vdpConfigRef.

configRef = Simulink.ConfigSetRef;
set_param(configRef,'SourceName','freeConfigSet');
set_param(configRef,'Name','vdpConfigRef');

Attach the configuration reference to the vdp model and activate it.

attachConfigSet('vdp',configRef);
setActiveConfigSet('vdp','vdpConfigRef');
Introduced in R2007a