Can we use parfor inside a for loop?
9 次查看(过去 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!