Main Content

applyToModel

Apply configuration specified on Simulink.SimulationIntput object to model

Description

example

applyToModel(simIn) applies the configuration specified on the Simulink.SimulationInput object simIn to the model specified in the object. Use this function to debug or interactively analyze a simulation.

applyToModel(simIn,'EnableConfigSetRefUpdate',configUpdate) applies the configuration specified in the Simulink.SimulationInput object simIn to the model specified in the object.

Examples

collapse all

This example shows how to modify a model to use the options specified in a Simulink.SimulationInput object and save those modifications.

Open the model and create a SimulationInput object.

openExample('simulink_general/sldemo_househeat');
simIn = Simulink.SimulationInput('sldemo_househeatExample');

Specify block parameter, model parameter, and variable values on a Simulink.SimulationInput object.

simIn = setBlockParameter(simIn,'sldemo_househeat/Set Point',...,
    'Value','75');
simIn = setVariable(simIn,'cost',50,'Workspace','sldemo_househeat');
simIn = setModelParameter(simIn,'StartTime','1','StopTime','5');

Apply the values specified on the Simulink.SimulationInput object to the model.

applyToModel(simIn)

Input Arguments

collapse all

Simulation inputs and configuration, specified as a Simulink.SimulationInput object.

Specify EnableConfigSetRefUpdate flag to 'on' to apply the ConfigSetRefs settings to the Simulink.SimulationInput object, for the model that uses reference configuration sets.

Version History

Introduced in R2017a