applyToModel - Apply configuration in SimulationInput object to

        model - MATLAB ([original](https://in.mathworks.com/help/simulink/slref/simulink.simulationinput.applytomodel.html)) ([raw](?raw))

Main Content

Apply configuration in SimulationInput object to model

Syntax

Description

applyToModel([simin](#mw%5F670c7ffc-4639-4044-bd83-48a928709c3c)) 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.

example

applyToModel([simin](#mw%5F670c7ffc-4639-4044-bd83-48a928709c3c),EnableConfigSetRefUpdate=[configupdate](#mw%5F676f8750-6c67-4bde-99d2-fed18aa458ca)) applies the configuration specified in the Simulink.SimulationInput object simin to the model specified in the object.

Examples

collapse all

Create a Simulink.SimulationInput object to configure a simulation of the model sldemo_househeat.

mdl = "sldemo_househeat"; simin = Simulink.SimulationInput(mdl);

Specify these values on the SimulationInput object:

blkpath = mdl + "/Set Point"; simin = setBlockParameter(simin,blkpath,"Value","75"); simin = setVariable(simin,"cost",50,Workspace="sldemo_househeat"); simin = setModelParameter(simin,StartTime="1",StopTime="5");

Simulate the model sldemo_househeat using the configuration stored in the SimulationInput object.

Suppose you want to further analyze the simulation based on the results from the programmatic simulation. To apply the configuration in the SimulationInput object to the model, use the applyToModel function.

To view the model in the Simulink Editor, open the model. The asterisk in the title bar indicates that the model has been modified, in this case by the call to the applyToModel function.

Input Arguments

collapse all

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

See Also

Objects

Functions

Topics