sr,1]); <span class="comment">% upsample</span>
0193     A=A(:); 
0194     A(end:size(x,1))=A(end);
0195     IDX{1}=find(A==0); <span class="comment">% 0: low values, 1: high values</span>
0196     
0197     <span class="keyword">if</span> isempty(IDX{1}) <span class="comment">% clustering failed, return just one cluster</span>
0198         IDX{1}=1:size(x,1);
0199         TODSS{1}=nan;
0200         SCORE{1}=nan;
0201         COVS{1}=<a href="nt_cov.html" class="code" title="function [c,tw]=nt_cov(x,shifts,