function cor=lagcor(a,b,n);
%function cor=lagcor(a,b,n);
%              n is range of lags
%              cor is correlation as fn of lag
cor=[];
for i=0:n
[d1 d2]=shift(a,b,i);
corr([d1 d2]);
   if length(ans)>1
       cor(i+1)=ans(1,2);
   end
end
