30 <span class="comment">% remove mean</span>
0031 <span class="comment">%x=nt_fold(nt_demean(nt_unfold(x),w),m);</span>
0032 
0033 <span class="comment">% covariance</span>
0034 <span class="keyword">if</span> isempty(w);
0035     c=<a href="nt_cov.html" class="code" title="function [c,tw]=nt_cov(x,shifts,w);">nt_cov</a>(x,shifts);
0036 <span class="keyword">else</span>
0037     <span class="keyword">if</span> sum(w(:))==0; error(<span class="string">'weights are all zero!'</span>); <span class="keyword">e