parfor and nested loop
古いコメントを表示
hi,
can I use parfor with nested loop?
for ex.
parfor i=1:5
for j=1:2
%%whatever
end
end
should I use par with each for or with one.
please, I need somebody can solve my problem.
Thanks in advance
回答 (2 件)
Mischa Kim
2014 年 1 月 23 日
1 投票
Hello huda, there are no nested parfor loops. Parallelization with parfor only works on the outermost loop.
To combine the loops into a single parfor loop,
parfor k=1:10
[i,j]=ind2sub([5,2],k);
%%whatever
end
3 件のコメント
huda nawaf
2014 年 1 月 24 日
Matt J
2014 年 1 月 24 日
The effectiveness of parfor depends a lot on what you're doing inside the loop.
huda nawaf
2014 年 1 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!