parfor and nested loop
Mostrar comentarios más antiguos
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
Respuestas (2)
Mischa Kim
el 23 de En. de 2014
1 voto
Hello huda, there are no nested parfor loops. Parallelization with parfor only works on the outermost loop.
1 comentario
huda nawaf
el 24 de En. de 2014
To combine the loops into a single parfor loop,
parfor k=1:10
[i,j]=ind2sub([5,2],k);
%%whatever
end
3 comentarios
huda nawaf
el 24 de En. de 2014
Matt J
el 24 de En. de 2014
The effectiveness of parfor depends a lot on what you're doing inside the loop.
huda nawaf
el 24 de En. de 2014
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!