a quadratic to errors at the different offsets</span>
0044 
0045 valid = (mx+1:T-mx);
0046 <span class="keyword">for</span> off = 1:length(testoff)
0047     temp = permute(template, [2,3,1]);
0048     templateShift(off,:,:) = <span class="keyword">...</span>
0049         permute(interp1(1:T,temp,valid+testoff(off),<span class="string">'linear'</span>), [3,1,2]);
0050 <span class="keyword">end</span>
0051 
0052 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%% Find Alignments %%%%%%%%%%%%%%%%%%%%%%%%%%</span>