Main Content

Simulink.ConfigSet

Model configuration set

Description

Use the Simulink.ConfigSet object to access a model configuration set. Get information about your configuration set and manage configuration parameters.

The Simulink.ConfigSet object is a handle object.

Creation

Use the getActiveConfigSet function to get the active configuration set for a model. Use the getConfigSet function to get a model configuration set by name.

Properties

expand all

Description of the configuration set, specified as a character vector. Use the description to provide additional information about a configuration set, such as its purpose.

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

Object Functions

copyCopy configuration set or reference
get_paramGet parameter names and values
set_paramSet Simulink parameter value

Examples

collapse all

Open the model vdp and get the active configuration set.

openExample('simulink_general/VanDerPolOscillatorExample');
configSetObj = getActiveConfigSet('vdp');

A Simulink.ConfigSet object stores a set of model configuration parameter values. You can specify a Simulink.ConfigSet object as an input to the sim function. The configuration set from the object is applied to the model for the simulation. After simulation, the original configuration set is restored in the model.

A Simulink.Configset object stores only model configuration parameter values. To specify model configuration parameter values, block parameter values, and variable values for a simulation in a single input, use a Simulink.SimulationInput object instead.

Open the model IntegrateSine. The model uses an Integrator block to integrate the output of a Sine Wave block. The output from the Integrator block is connected to an Outport block.

mdl = "IntegrateSine";
open_system(mdl)

The model IntegrateSine.

Use the getActiveConfigSet function to get a Simulink.ConfigSet object for the current model configuration.

mdlConfig = getActiveConfigSet(mdl);

Use the copy function to create a copy of the Simulink.ConfigSet object to modify.

simConfig = copy(mdlConfig);

Modify the Simulink.ConfigSet object simConfig to use the solver ode45 and a stop time of 20 seconds.

set_param(simConfig,"Solver","ode45","StopTime","20");

Simulate the model using the configuration parameters in the Simulink.Configset object simConfig.

out = sim(mdl,simConfig);

The model simulates through a simulation time of 20 seconds using the ode45 solver.

A Dashboard Scope block displays the input and output of the Integrator block.

Version History

Introduced in R2006a