title: How to fix "Index in position 1 exceeds array bounds"
body: <pre><code> x = gallery('uniformdata',[1,10],0);
   y = gallery('uniformdata',[1,10],1);
   [v,c] = voronoin([x(:) y(:)]); %returns an array V with vertices and a cell array C with a matrix for each cell of the diagram. 
   v = v( ~any( isnan( v ) | isinf( v ), 2 ),: );
   for ii=1:numel(c)
          v(c{ii},:) %contains the vertices to cell number ii, corresponding to centroid x,y(ii,:).     
   end
  </code></pre>
  
  <p>The <code>v(c{1},:)</code> seems to execute just fine ,but once it reaches <code>v(c{2},:)</code> I get this error</p>
  
  <p>"Index in position 1 exceeds array bounds (must not exceed 13)."</p>
  
  <p>NOTE: <code>numel(v)</code> returns 13</p>
  
  <p>I tried <code>for ii=1:numel(c)-1</code> ,but that doesn't seem to work either</p>