Can we use parfor inside a for loop?
6 ビュー (過去 30 日間)
古いコメントを表示
Can a parfor loop be used in side a for loop. I want to run a series of iterations with parfor inside the for loop. How to do this?
0 件のコメント
回答 (2 件)
Sean de Wolski
2012 年 3 月 14 日
Sure!
matlabpool open 2
for ii = 1:3
parfor jj = 1:3
disp([ jj ii])
end
end
matlabpool close
0 件のコメント
Konrad Malkowski
2012 年 3 月 19 日
If you have multiple nested for loop, then for best performance you really want the parfor to be the outermost loop in your program.
0 件のコメント
参考
カテゴリ
Help Center および 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!