Running multiple simulations simultaneously

조회 수: 2 (최근 30일)
Deepa Maheshvare
Deepa Maheshvare 2019년 10월 21일
답변: Sai Sri Pathuri 2019년 11월 6일
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
Stephen23
Stephen23 2019년 10월 21일
편집: Stephen23 2019년 10월 21일
Deepa Maheshvare
Deepa Maheshvare 2019년 10월 21일
Could you please explain a bit more? I'm not sure if I understand

댓글을 달려면 로그인하십시오.

채택된 답변

Sai Sri Pathuri
Sai Sri Pathuri 2019년 11월 6일
You may use parfor loop to execute the iterations parallelly. The documentation for parfor loop can be referred from the following link

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by