function ht=autoc2(ts,mn,mx)%,autoc_bins,autoc_step) if ~exist('mn','var') mn=0; mx=1; end overl=5000; ksel=1:min(numel(ts),overl); %memory overload ht=[]; if numel(ts)>1 while ~isempty(ksel) haux=bsxfun(@minus,ts(ksel),ts(ksel)'); ht=[ht; haux(haux>mn & haux