Running multiple simulations simultaneously
1 view (last 30 days)
Show older comments
Deepa Maheshvare
on 21 Oct 2019
Answered: Sai Sri Pathuri
on 6 Nov 2019
I'm solving a system of odes present in function1 for different set of initial conditions.
for i = 1:10
x0 = rand(10,1)
[t x] = ode15s(@(t,s) function1(t,s), tspan , x0);
field = "x" + num2str(i);
soln.(field) = x
end
I'd like to run these simulations parallely, i.e. for all i's at once.
Could someone suggest how this can be done?
2 Comments
Accepted Answer
Sai Sri Pathuri
on 6 Nov 2019
You may use parfor loop to execute the iterations parallelly. The documentation for parfor loop can be referred from the following link
0 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!