     IDX2={};
0058     <span class="keyword">if</span> numel(I)&gt;1
0059         <span class="keyword">for</span> k=1:numel(I2)
0060             IDX2=[IDX2, I{2}(I2{k})];
0061         <span class="keyword">end</span>
0062     <span class="keyword">end</span>
0063     IDX=[IDX1 IDX2];
0064     <a href="#_sub3" class="code" title="subfunction checkindex(IDX,n)">checkindex</a>(IDX,size(x,1))
0065     
0066     <span class="keyword">while</span> numel(IDX)&gt;N;
0067         <span class="comment">% merge clust