This example shows how to use the cancel
method on
an array of future
objects to stop the simulations.
This example runs several simulations of the vdp
model, varying the
value of the gain Mu.
Open the model and define a vector of Mu
values.
Using Mu_Values
, initialize an array of
Simulink.SimulationInput
objects. To preallocate the array, a loop
index is made to start from the largest
value.
Simulate the model using parsim
. Set to
'RunInBackground
' to enable the use the command prompt, while
simulations are running.
Now, assume that you want to run simulations with different values of Mu and cancel
the ongoing
simulations.