Running multiple simulations simultaneously

1 回表示 (過去 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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by