フィルターのクリア

make two while loop work parallely

4 ビュー (過去 30 日間)
John Carlson
John Carlson 2019 年 1 月 17 日
コメント済み: John Carlson 2019 年 1 月 20 日
I want to run two while functions at the same time , for example make two cores of my computer work on loop 1 and two cores on loop 2 .
Is it possible in matlab ?

採用された回答

Walter Roberson
Walter Roberson 2019 年 1 月 17 日
If you have the Parallel Computing Toolbox, you can use
parpool(2)
parfevalOnAll(@maxNumCompThreads, 0, 2)
spmd
if labindex == 1
first_function
else
second_function
end
end
  1 件のコメント
John Carlson
John Carlson 2019 年 1 月 20 日
Thanks a lot , it worked just fine.

サインインしてコメントする。

その他の回答 (1 件)

nanren888
nanren888 2019 年 1 月 17 日
Sure, run two Matlabs.
Why?
  1 件のコメント
John Carlson
John Carlson 2019 年 1 月 20 日
It's not possible for some problems.
For example if you are connecting with a raspberry pi you can only publish one connection through one matlab .

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeParallel Computing Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by