function lim=extrapolate(e) % lim=extrapolate(e) % compute lim assuming that e(i+1)-lim = c*(e(i)-lim) % if e is matrix extrapolate rows % (x-lim)/(y-lim)=(y-lim)/(z-lim) x=e(i) y=e(i+1) z=e(i+2) % (x-lim)*(z-lim)=(y-lim)^2 % x*z - lim*(x+z) + lim^2 = y^2 - lim*2y + lim^2 % lim = (x*z - y*y)/(x+z-2*y) i=1:size(e,2)-2; x=e(:,i); y=e(:,i+1); z=e(:,i+2); lim=(x.*z - y.*y)./((x-y)+(z-y));