MATLAB Answers

Mats
0

sim command for parameter sweeps

Asked by Mats
on 1 Apr 2015
Latest activity Answered by Rahul Kumar on 1 Sep 2018
I have a Simulink model which i want to perform a parameter sweep on, code is as follows:
parfor n=1:N
nServ = Parm(n);
B = sim('sweep');
data{:,n} = B.get('yout');
time{:,n} = B.get('tout');
end
If I remove the par.. this works in serial but in parfor it complains on the first line (me setting nServ which sets number of servers available from a predefined array.
Is there any better way to run parameter sweeps that work both in serial and parallel?

  0 Comments

Sign in to comment.

1 Answer

Answer by Rahul Kumar on 1 Sep 2018

R2017a introduced the parsim command to make it easier to do parameter sweeps (and more)
Please try it out and let us know if you have any questions.

  0 Comments

Sign in to comment.