FOR to PARFOR - cannot make it right
Afficher commentaires plus anciens
Hello everyone,
I am having troubles of adjusting FOR loop codes below to PARFOR loop. Hopefully, you can help me out. Thank you so much in advance.
for i = 1:size(t2,1)-1
x = find(t1.v1>t2.v1(i) & t1.v1<=t2.v1(a+1));
t1.v2(x(t1.v2(x)~=t2.v2(a))) = 0;
end
PS: I am not sure if I give out enough information, please let me know if you need me to clear out anything.
2 commentaires
Joseph Cheng
le 8 Juil 2014
I do not think this is a case where you can use PARFOR. in the t1.v2() line you maybe indexing the same values in x in parallel loops. what is the error it gives you when you try this?
Hai Nguyen
le 8 Juil 2014
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!