QUADINTERP Fast quadratic interpolation for arbitrary-sized arrays. QUADINTERP is a low-level function called by RIDGEINTERP. XI=QUADINTERP(T1,T2,T3,X1,X2,X3,TI) interpolates a function X within an independent variable T using a quadratic algorithm. The function values X1--X3 may be arrays of any size provided they are all the same size. The "time" values T1--T3 may be scalars, or arrays of the same size as X1--X3. If T1--T3 and X1--X3 are non-scalar arrays, T should either be a scalar or an array of the same size as the other arguments. If T1--T3 and X1--X3 are all scalars, T may be of any size, and XI will have the same size as T. The function values X1--X3 may be real or complex. QUADINTERP uses the exact algebraic expressions to operate looplessly on matrices, thus it is very fast. __________________________________________________________________ Locating maxima or minima QUADINTERP can also be used to find the extreme value of X(T), that is its maxima or minima. [XE,TE]=QUADINTERP(T1,T2,T3,X1,X2,X3) with only six input arguments solves for TE, the time at which X(T) obtains an extreme value XE. XE and TE are the same size as the input arrays. __________________________________________________________________ Algorithm details Let X and T be related as X = A*T.^2 + B*T + C The coefficients A, B, and C are uniquely determined by three (T,X) pairs. QUADINTERP solves for these coefficients and uses the result to interpolate X to any other value of T. __________________________________________________________________ See also LININTERP, CUBEINTERP. Usage: x=quadinterp(t1,t2,t3,x1,x2,x3,t); [xe,te]=quadinterp(t1,t2,t3,x1,x2,x3,t); __________________________________________________________________ This is part of JLAB --- type 'help jlab' for more information (C) 2006 J.M. Lilly --- type 'help jlab_license' for details