title: parfor in matlab. sliced variable and nested loop
body: <p>I did my best to follow the documentation of the parallel toolbox, but still I could not avoid  the problem of reusing array that was indexed in a nested loop.
  The problem is with variable <i>node</i></p>
  
  <pre><code>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
  </code></pre>
  
  <p>I do not use the array outside of the nested loop, the indexing is also according to the rule. Did I miss another <i>parfor</i> restriction?</p>