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!