Main Content

setPreSimFcn

Specify aMATLABfunction to run before start of each simulation throughSimulationInputobject, in

Description

in = in.setPreSimFcn(@(x) myfunction(arg1, arg2 ...))runs before each simulation starts. TheSimulink.SimulationInputobject is passed as an argumentxto this function.myfunctionis any MATLAB®function and can be used to modify theSimulink.SimulationInputobject. If you usemyfunctionto modify theSimulink.SimulationInputobject, you must returnSimulink.SimulationInputobject as the only output argument.

Input Arguments

collapse all

This is an input tomyfunctionin which you can modify theSimulink.SimulationInputobject.

Arguments specified to pass to thesetPreSimFcn.

Introduced in R2017a