Code covered by the BSD License
-
baryinv(x, y, xi, c)
BARYINV 1-D barycentric interpolation with inverse distance weighting
-
cakima(x, y, xi)
CAKIMA 1-D piecewise cubic Akima interpolation
-
cbezier(x, y, xi)
CBEZIER 1-D piecewise cubic Bezier spline interpolation
-
chermite(x, y, yp, xi, c)
CHERMITE 1-D piecewise cubic Hermite spline
-
cosint(x, y, xi)
COSINT 1-D piecewise cosine interpolation
-
cubiconv(x, y, xi)
CUBICONV Cubic convolution interpolation
-
divdiff(x, y, yp, ypp)
DIVDIFF Divided differences.
-
expint(x, y, xi)
EXPINT 1-D piecewise exponential interpolation
-
floaterhormann(x, y, xi, c)
FLOATERHORMANN Rational interpolation using the Floater-Hormann Method
-
hermint(x, y, yp, xi, c)
HERMINT 1-D piecewise hermite interpolation
-
interpdct(x,ny,dim)
INTERPDCT 1-D interpolation using DCT method
-
lagint(x, y, xi, c)
LAGINT 1-D piecewise lagrange interpolation
-
mqspline(x, y, yp, xi, c)
MQSPLINE 1-D piecewise monotone quadratic spline interpolation
-
neville(x, y, xi)
NEVILLE Interpolation using Neville's Method
-
newtint(x, y, xi, c)
NEWTINT Interpolation of equally-spaced points.
-
qhermite(x, y, yp, ypp, xi, v...
QHERMITE 1-D piecewise quintic Hermite spline
-
rchermite(x, y, yp, xi, r, c)
RCHERMITE 1-D piecewise rational cubic Hermite spline
-
said(x, y, xi, chi, eta, c)
SAID 1-D piecewise Said interpolation
-
schwerner(x, y, xi, p, q)
SCHWERNER Rational interpolation using the Schneider-Werner Method
-
shermite(x, y, yp, ypp, yppp,...
SHERMITE 1-D piecewise septic Hermite spline
-
sincdint(x, y, xi, c)
SINCDINT 1-D piecewise discrete sinc interpolation
-
sincint(x, y, xi, c, win)
SINCINT 1-D piecewise sinc interpolation
-
trigint(x, y, xi, c)
hRIGINT 1-D piecewise trigonometric interpolation
-
View all files
from
Interpolation Utilities
by Joe Henning
A variety of interpolation utilities
|
| baryinv(x, y, xi, c)
|
function [yi, u] = baryinv(x, y, xi, c)
% BARYINV 1-D barycentric interpolation with inverse distance weighting
% BARYINV(X,Y,XI,C) interpolates to find YI, the values of the
% underlying function Y at the points in the array XI, using
% the second form (or true form) of the barycentric interpolation
% formula and inverse distance weighting. X and Y must be vectors
% of length N.
%
% C specifies the order of the inverse distance weighting. It
% defaults to 1 (Shepard's interpolant).
%
% [YI,U] = BARYINV() also returns the barycentric interpolation
% weights U.
% Joe Henning - Fall 2011
if (nargin < 4)
c = 1;
end
n = length(x);
for i = 1:length(xi)
% Find the right place in the table by means of a bisection.
klo = 1;
khi = n;
while (khi-klo > 1)
k = fix((khi+klo)/2.0);
if (x(k) > xi(i))
khi = k;
else
klo = k;
end
end
h = x(khi) - x(klo);
if (h == 0.0)
fprintf('??? Bad x input to baryinv ==> x values must be distinct\n');
yi(i) = NaN;
continue;
end
isiny = 0;
for k = 1:n
if (xi(i) == x(k))
yi(i) = y(k);
isiny = 1;
break
end
end
if (isiny)
continue
end
% Evaluate weighted polynomial
num = 0;
den = 0;
for k = 1:n
u(k,1) = (1/(xi(i)-x(k)))^c;
num = num + u(k)*y(k)/(xi(i)-x(k));
den = den + u(k)/(xi(i)-x(k));
end
yi(i) = num/den;
end
|
|
Contact us