applyToModel

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

Description

example

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.

Examples

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.

open_system('sldemo_househeat');
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.

in.applyToModel

Introduced in R2017a