Can we use parfor inside a for loop?
조회 수: 7 (최근 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!