attachComponent

Attach a component to a configuration set

Description

example

attachComponent(cs,component) attaches a component to a Simulink.ConfigSet object.

Examples

collapse all

Replace the solver component of the active configuration set of one model with the solver component of another model.

Get the active configuration set for modelB.

hCs = getActiveConfigSet('modelB');

Get the 'Solver' component for this configuration set.

hSolverConfig = getComponent(hCs,'Solver');

Create a copy of the component.

hSolverConfig = copy(hSolverConfig);

Get the active configuration set for modelA.

hCs = getActiveConfigSet('modelA');

Attach the copy of the 'Solver' component from modelB to modelA.

attachComponent(hCs,hSolverConfig);

Input Arguments

collapse all

A configuration set object that you can attach a component to.

A component that you can attach to configuration set.

Introduced before R2006a