FOR to PARFOR - cannot make it right
이전 댓글 표시
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
Joseph Cheng
2014년 7월 8일
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
2014년 7월 8일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!