parfor indexing and order
Mostra commenti meno recenti
[a,b,c]=size(Mask); % a=b=c=3;
parfor i=1:size(Mask,3)
i
end
I was expecting to see i=1,i=2,i=3 in a sequence as one would see in a for loop but it is giving me i=3,i=2,i=1 . This is in reverse order. I cant figure out the reason.
Risposta accettata
Più risposte (1)
Edric Ellis
il 4 Apr 2013
0 voti
PARFOR loops can run in parallel, and as such, the iterations might run in any order. You should not rely on this order. In particular, as you have observed, PARFOR starts running iterations in reverse order.
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!