This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Apply changes to the model specified through a SimulationInput object, in





in.applyToModel applies the changes specified through the SimulationInput object to the model. You can use it to debug a model or to interactively analyze a simulation.


collapse all

This example shows how to modify a model through a SimulationInput object and save those modifications.

Open the model and create a SimulationInput object.

in = Simulink.SimulationInput('sldemo_househeat');

Modify block parameter, model parameters and a variable through SimulationInput object.

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

Apply the modifications made in the above step to the model.


Introduced in R2017a