我尽力遵循并行工具箱的文档,但仍然无法避免重用嵌套循环中索引的数组的问题。问题在于变量节点
parfor i=1:nX
for j=1:nY
[ind,dist]=findInCircle(node(i,j,:), part,r);
UV=calcVelocity(part(ind,:), dist,node(i,j,:)) ;
%here matlab complains that node is not indexed properly
node(i,j,3)= UV(1);
node(i,j,4)= UV(2);
node(i,j,5)= UV(3);
end
end
我不使用嵌套循环之外的数组,索引也是按照规则。我错过了另一个parfor限制吗?