Main Content

getRefConfigSet

Get configuration set from configuration reference

    Description

    example

    configObj = getRefConfigSet(configRef) returns the configuration set or configuration reference that is referenced by configRef.

    Examples

    collapse all

    Create a ConfigSetRef object that references a freestanding configuration set, then get the ConfigSet handle representing that configuration set. Change model parameter values through this handle.

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

    openExample('simulink_general/VanDerPolOscillatorExample');
    model = 'vdp';
    freeConfigSet = copy(getActiveConfigSet(model));

    Create a configuration reference, and point the reference to your freestanding configuration.

    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');

    Get the freestanding configuration set referenced by configRef and assign it to a new ConfigSet handle.

    referencedConfig = getRefConfigSet(configRef);

    Use the new ConfigSet handle to modify parameter values in the referenced configuration set.

    set_param(referencedConfig,SignalLogging='off');
    set_param(referencedConfig,StartTime='10');

    Input Arguments

    collapse all

    Configuration reference, specified as a Simulink.ConfigSetRef object.

    Output Arguments

    collapse all

    Configuration object, returned as a Simulink.ConfigSet object or a Simulink.ConfigSetRef object.