FOR to PARFOR - cannot make it right
Mostrar comentarios más antiguos
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 comentarios
Joseph Cheng
el 8 de Jul. de 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
el 8 de Jul. de 2014
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Parallel for-Loops (parfor) en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!