LININTERP Fast linear interpolation for arbitrary-sized arrays. LININTERP is a low-level function called by RIDGEINTERP. XI=LININTERP(T1,T2,X1,X2,TI) interpolates a function X within an independent variable T using a linear algorithm. The function values X1 and X2 may be arrays of any size provided they are the same size. The "time" values T1 and T2 may be scalars, or arrays of the same size as X1 and X2. If T1 and T2 and X1 and X2 are non-scalar arrays, T should either be a scalar or an array of the same size as the other arguments. If T1 and T2 and X1 and X2 are all scalars, T may be of any size, and XI will have the same size as T. The function values X1 and X2 may be real or complex. LININTERP uses the exact algebraic expressions to operate looplessly on matrices, thus it is very fast. __________________________________________________________________ Locating x-intercept LININTERP can also be used to find the x-intercept value of X(T). TO=LININTERP(T1,T2,X1,X2) with only four input arguments returns TO, the time at which X(T) vanishes. TO is the same size as the input arrays. __________________________________________________________________ Algorithm details Let X and T be related as X = A*T + B The coefficients A and B are uniquely determined by two (T,X) pairs. LININTERP solves for these coefficients and uses the result to interpolate X to any other value of T. __________________________________________________________________ See also QUADINTERP, CUBINTERP. Usage: x=lininterp(t1,t2,x1,x2,t); __________________________________________________________________ This is part of JLAB --- type 'help jlab' for more information (C) 2011--2012 J.M. Lilly --- type 'help jlab_license' for details