">%</span>
0011 <span class="comment">%   NOTE: A matrix input 'timeseries' is treated as 'timeseries(:)'</span>
0012 
0013 <span class="keyword">if</span> (nargin &lt; 3)
0014     error(<span class="string">'Incorrect number of arguments.'</span>);
0015 <span class="keyword">end</span>
0016 
0017 <span class="comment">% Column-ize the time series.</span>
0018 timeseries = timeseries(:);
0019 
0020 M = length(timeseries);  <span class="comment">% length of input time series</span>
0021 N = M - lag * (D-1); 