cancel(Future) stops the objects of the
Simulink.Simulation.Future array, Future, that are
currently in 'pending', 'queued', or
'running' state. For elements of the Futures in the
'finished' state, no action is taken.
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.
for i = MuVal_length:-1:1
in(i) = Simulink.SimulationInput('vdp');
in(i) = in(i).setBlockParameter('vdp/Mu',...'Gain',num2str(Mu_Values(i)));
end
Simulate the model using parsim. Set to
'RunInBackground' to enable the use the command prompt, while
simulations are running.
Future = parsim(in,'RunInBackground','on');
Now, assume that you want to run simulations with different values of Mu and cancel
the ongoing
simulations.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.