- •Vector format when working in 2d and 3d.
- •Spline interpolation
- •Geometric analysis
- •In 2d/3d space. A 2d Delaunay triangulation ensures that the circumcircle
- •Delaunay Triangulation.
- •Voronoi vertices, where numv is the number of vertices and ndim is the
- •Polynomials
- •Vectors of polynomial coefficients, convolving them is equivalent to
matlab\polyfun- Интерполяция и многочлены
Data interpolation
<pchip> - Piecewise cubic Hermite interpolating polynomial.
PCHIP Piecewise Cubic Hermite Interpolating Polynomial.
PP = PCHIP(X,Y) provides the piecewise polynomial form of a certain
shape-preserving piecewise cubic Hermite interpolant, to the values
Y at the sites X, for later use with PPVAL and the spline utility UNMKPP.
X must be a vector.
If Y is a vector, then Y(j) is taken as the value to be matched at X(j),
hence Y must be of the same length as X.
If Y is a matrix or ND array, then Y(:,...,:,j) is taken as the value to
be matched at X(j), hence the last dimension of Y must equal length(X).
YY = PCHIP(X,Y,XX) is the same as YY = PPVAL(PCHIP(X,Y),XX), thus
providing, in YY, the values of the interpolant at XX.
The PCHIP interpolating function, p(x), satisfies:
On each subinterval, X(k) <= x <= X(k+1), p(x) is the cubic Hermite
interpolant to the given values and certain slopes at the two endpoints.
Therefore, p(x) interpolates Y, i.e., p(X(j)) = Y(:,j), and
the first derivative, Dp(x), is continuous, but
D^2p(x) is probably not continuous; there may be jumps at the X(j).
The slopes at the X(j) are chosen in such a way that
p(x) is "shape preserving" and "respects monotonicity". This means that,
on intervals where the data is monotonic, so is p(x);
at points where the data have a local extremum, so does p(x).
Comparing PCHIP with SPLINE:
The function s(x) supplied by SPLINE is constructed in exactly the same way,
except that the slopes at the X(j) are chosen differently, namely to make
even D^2s(x) continuous. This has the following effects.
SPLINE is smoother, i.e., D^2s(x) is continuous.
SPLINE is more accurate if the data are values of a smooth function.
PCHIP has no overshoots and less oscillation if the data are not smooth.
PCHIP is less expensive to set up.
The two are equally expensive to evaluate.
Example:
x = -3:3;
y = [-1 -1 -1 0 1 1 1];
t = -3:.01:3;
plot(x,y,'o',t,[pchip(x,y,t); spline(x,y,t)])
legend('data','pchip','spline',4)
Class support for inputs x, y, xx:
float: double, single
See also interp1, spline, ppval, unmkpp.
Reference page in Help browser
doc pchip
<interp1> - 1-D interpolation (table lookup).
INTERP1 1-D interpolation (table lookup)
YI = INTERP1(X,Y,XI) interpolates to find YI, the values of the
underlying function Y at the points in the array XI. X must be a
vector of length N.
If Y is a vector, then it must also have length N, and YI is the
same size as XI. If Y is an array of size [N,D1,D2,...,Dk], then
the interpolation is performed for each D1-by-D2-by-...-Dk value
in Y(i,:,:,...,:).
If XI is a vector of length M, then YI has size [M,D1,D2,...,Dk].
If XI is an array of size [M1,M2,...,Mj], then YI is of size
[M1,M2,...,Mj,D1,D2,...,Dk].
YI = INTERP1(Y,XI) assumes X = 1:N, where N is LENGTH(Y)
for vector Y or SIZE(Y,1) for array Y.
Interpolation is the same operation as "table lookup". Described in
"table lookup" terms, the "table" is [X,Y] and INTERP1 "looks-up"
the elements of XI in X, and, based upon their location, returns
values YI interpolated within the elements of Y.
YI = INTERP1(X,Y,XI,METHOD) specifies alternate methods.
The default is linear interpolation. Use an empty matrix [] to specify
the default. Available methods are:
'nearest' - nearest neighbor interpolation
'linear' - linear interpolation
'spline' - piecewise cubic spline interpolation (SPLINE)
'pchip' - shape-preserving piecewise cubic interpolation
'cubic' - same as 'pchip'
'v5cubic' - the cubic interpolation from MATLAB 5, which does not
extrapolate and uses 'spline' if X is not equally
spaced.
YI = INTERP1(X,Y,XI,METHOD,'extrap') uses the interpolation algorithm
specified by METHOD to perform extrapolation for elements of XI outside the
interval spanned by X. YI = INTERP1(X,Y,XI,METHOD,EXTRAPVAL) replaces the
values outside of the interval spanned by X with EXTRAPVAL. NaN and 0 are
often used for EXTRAPVAL. The default extrapolation behavior with four
input arguments is 'extrap' for 'spline' and 'pchip' and EXTRAPVAL = NaN for
the other methods.
PP = INTERP1(X,Y,METHOD,'pp') will use the interpolation algorithm specified
by METHOD to generate the ppform (piecewise polynomial form) of Y. The
method may be any of the above METHOD except for 'v5cubic'. PP may then be
evaluated via PPVAL. PPVAL(PP,XI) is the same as
INTERP1(X,Y,XI,METHOD,'extrap').
For example, generate a coarse sine curve and interpolate over a
finer abscissa:
x = 0:10; y = sin(x); xi = 0:.25:10;
yi = interp1(x,y,xi); plot(x,y,'o',xi,yi)
For a multi-dimensional example, we construct a table of functional
values:
x = [1:10]'; y = [ x.^2, x.^3, x.^4 ];
xi = [ 1.5, 1.75; 7.5, 7.75]; yi = interp1(x,y,xi);
creates 2-by-2 matrices of interpolated function values, one matrix for
each of the 3 functions. yi will be of size 2-by-2-by-3.
Class support for inputs X, Y, XI, EXTRAPVAL:
float: double, single
See also interp1q, interpft, spline, pchip, interp2, interp3, interpn, ppval.
Reference page in Help browser
doc interp1
<interp1q> - Quick 1-D linear interpolation.
INTERP1Q Quick 1-D linear interpolation.
F=INTERP1Q(X,Y,XI) returns the value of the 1-D function Y at the points
of column vector XI using linear interpolation. Length(F)=length(XI).
The vector X specifies the coordinates of the underlying interval.
If Y is a matrix, then the interpolation is performed for each column
of Y in which case F is length(XI)-by-size(Y,2).
NaN's are returned for values of XI outside the coordinates in X.
INTERP1Q is quicker than INTERP1 on non-uniformly spaced data because
it does no input checking. For INTERP1Q to work properly:
X must be a monotonically increasing column vector.
Y must be a column vector or matrix with length(X) rows.
Class support for inputs x, y, xi:
float: double, single
See also interp1.
Reference page in Help browser
doc interp1q
<interpft> - 1-D interpolation using FFT method.
INTERPFT 1-D interpolation using FFT method.
Y = INTERPFT(X,N) returns a vector Y of length N obtained
by interpolation in the Fourier transform of X.
If X is a matrix, interpolation is done on each column.
If X is an array, interpolation is performed along the first
non-singleton dimension.
INTERPFT(X,N,DIM) performs the interpolation along the
dimension DIM.
Assume x(t) is a periodic function of t with period p, sampled
at equally spaced points, X(i) = x(T(i)) where T(i) = (i-1)*p/M,
i = 1:M, M = length(X). Then y(t) is another periodic function
with the same period and Y(j) = y(T(j)) where T(j) = (j-1)*p/N,
j = 1:N, N = length(Y). If N is an integer multiple of M,
then Y(1:N/M:N) = X.
Example:
% Set up a triangle-like signal signal to be interpolated
y = [0:.5:2 1.5:-.5:-2 -1.5:.5:0]; % equally spaced
factor = 5; % Interpolate by a factor of 5
m = length(y)*factor;
x = 1:factor:m;
xi = 1:m;
yi = interpft(y,m);
plot(x,y,'o',xi,yi,'*')
legend('Original data','Interpolated data')
Class support for data input x:
float: double, single
See also interp1.
Reference page in Help browser
doc interpft
<interp2> - 2-D interpolation (table lookup).
INTERP2 2-D interpolation (table lookup).
ZI = INTERP2(X,Y,Z,XI,YI) interpolates to find ZI, the values of the
underlying 2-D function Z at the points in matrices XI and YI.
Matrices X and Y specify the points at which the data Z is given.
XI can be a row vector, in which case it specifies a matrix with
constant columns. Similarly, YI can be a column vector and it
specifies a matrix with constant rows.
ZI = INTERP2(Z,XI,YI) assumes X=1:N and Y=1:M where [M,N]=SIZE(Z).
ZI = INTERP2(Z,NTIMES) expands Z by interleaving interpolates between
every element, working recursively for NTIMES. INTERP2(Z) is the
same as INTERP2(Z,1).
ZI = INTERP2(...,METHOD) specifies alternate methods. The default
is linear interpolation. Available methods are:
'nearest' - nearest neighbor interpolation
'linear' - bilinear interpolation
'spline' - spline interpolation
'cubic' - bicubic interpolation as long as the data is
uniformly spaced, otherwise the same as 'spline'
For faster interpolation when X and Y are equally spaced and monotonic,
use the syntax ZI = INTERP2(...,*METHOD).
ZI = INTERP2(...,METHOD,EXTRAPVAL) specificies a method and a scalar
value for ZI outside of the domain created by X and Y. Thus, ZI will
equal EXTRAPVAL for any value of YI or XI which is not spanned by Y
or X respectively. A method must be specified for EXTRAPVAL to be used,
the default method is 'linear'.
All the interpolation methods require that X and Y be monotonic and
plaid (as if they were created using MESHGRID). If you provide two
monotonic vectors, interp2 changes them to a plaid internally.
X and Y can be non-uniformly spaced.
For example, to generate a coarse approximation of PEAKS and
interpolate over a finer mesh:
[x,y,z] = peaks(10); [xi,yi] = meshgrid(-3:.1:3,-3:.1:3);
zi = interp2(x,y,z,xi,yi); mesh(xi,yi,zi)
Class support for inputs X, Y, Z, XI, YI:
float: double, single
See also interp1, interp3, interpn, meshgrid, TriScatteredInterp.
Reference page in Help browser
doc interp2
<interp3> - 3-D interpolation (table lookup).
INTERP3 3-D interpolation (table lookup).
VI = INTERP3(X,Y,Z,V,XI,YI,ZI) interpolates to find VI, the values
of the underlying 3-D function V at the points in arrays XI,YI
and ZI. XI,YI,ZI must be arrays of the same size or vectors.
Vector arguments that are not the same size, and have mixed
orientations (i.e. with both row and column vectors) are passed
through MESHGRID to create the Y1,Y2,Y3 arrays. Arrays X,Y and Z
specify the points at which the data V is given.
VI = INTERP3(V,XI,YI,ZI) assumes X=1:N, Y=1:M, Z=1:P
where [M,N,P]=SIZE(V).
VI = INTERP3(V,NTIMES) expands V by interleaving interpolates
between every element, working recursively for NTIMES.
INTERP3(V) is the same as INTERP3(V,1).
VI = INTERP3(...,METHOD) specifies alternate methods. The default
is linear interpolation. Available methods are:
'nearest' - nearest neighbor interpolation
'linear' - linear interpolation
'spline' - spline interpolation
'cubic' - cubic interpolation as long as the data is uniformly
spaced, otherwise the same as 'spline'
VI = INTERP3(...,METHOD,EXTRAPVAL) specifies a method and a value for
VI outside of the domain created by X,Y and Z. Thus, VI will equal
EXTRAPVAL for any value of XI,YI or ZI that is not spanned by X,Y and Z
respectively. A method must be specified for EXTRAPVAL to be used, the
default method is 'linear'.
All the interpolation methods require that X,Y and Z be monotonic and
plaid (as if they were created using MESHGRID). X,Y, and Z can be
non-uniformly spaced.
For example, to generate a course approximation of FLOW and
interpolate over a finer mesh:
[x,y,z,v] = flow(10);
[xi,yi,zi] = meshgrid(.1:.25:10,-3:.25:3,-3:.25:3);
vi = interp3(x,y,z,v,xi,yi,zi); % vi is 25-by-40-by-25
slice(xi,yi,zi,vi,[6 9.5],2,[-2 .2]), shading flat
See also interp1, interp2, interpn, meshgrid.
Reference page in Help browser
doc interp3
<interpn> - N-D interpolation (table lookup).
INTERPN N-D interpolation (table lookup).
VI = INTERPN(X1,X2,X3,...,V,Y1,Y2,Y3,...) interpolates to find VI,
the values of the underlying N-D function V at the points in
arrays Y1,Y2,Y3,etc. For an N-D V, INTERPN should be called with
2*N+1 arguments. Arrays X1,X2,X3,etc. specify the points at which
the data V is given. Out of range values are returned as NaN's.
Y1,Y2,Y3,etc. must be arrays of the same size or vectors. Vector
arguments that are not the same size, and have mixed orientations
(i.e. with both row and column vectors) are passed through NDGRID to
create the Y1,Y2,Y3,etc. arrays. INTERPN works for all N-D arrays
with 2 or more dimensions.
VI = INTERPN(V,Y1,Y2,Y3,...) assumes X1=1:SIZE(V,1),X2=1:SIZE(V,2),etc.
VI = INTERPN(V,NTIMES) expands V by interleaving interpolates between
every element, working recursively for NTIMES.
VI = INTERPN(V) is the same as INTERPN(V,1).
VI = INTERPN(...,METHOD) specifies alternate methods. The default
is linear interpolation. Available methods are:
'nearest' - nearest neighbor interpolation
'linear' - linear interpolation
'spline' - spline interpolation
'cubic' - cubic interpolation as long as the data is uniformly
spaced, otherwise the same as 'spline'
VI = INTERPN(...,METHOD,EXTRAPVAL) specifies a method and a value for
VI outside of the domain created by X1,X2,... Thus, VI will equal
EXTRAPVAL for any value of Y1,Y2,.. that is not spanned by X1,X2,...
respectively. A method must be specified for EXTRAPVAL to be used, the
default method is 'linear'.
INTERPN requires that X1,X2,X3,etc. be monotonic and plaid (as if
they were created using NDGRID). X1,X2,X3,etc. can be non-uniformly
spaced.
For example, interpn may be used to interpolate the function:
f = @(x,y,z,t) t.*exp(-x.^2 - y.^2 - z.^2);
Build the lookup table by evaluating the function f on a grid
constructed by ndgrid:
[x,y,z,t] = ndgrid(-1:0.2:1,-1:0.2:1,-1:0.2:1,0:2:10);
v = f(x,y,z,t);
Construct a finer grid:
[xi,yi,zi,ti] = ndgrid(-1:0.05:1,-1:0.08:1,-1:0.05:1,0:0.5:10);
Interpolate f on the finer grid by using splines:
vi = interpn(x,y,z,t,v,xi,yi,zi,ti,'spline');
And finally, visualize the function:
nframes = size(ti, 4);
for j = 1:nframes
slice(yi(:,:,:,j), xi(:,:,:,j), zi(:,:,:,j), vi(:,:,:,j),0,0,0);
caxis([0 10]);
M(j) = getframe;
end
movie(M);
Class support for data inputs:
float: double, single
See also interp1, interp2, interp3, ndgrid.
Reference page in Help browser
doc interpn
<griddata> - Data gridding and surface fitting.
GRIDDATA Data gridding and surface fitting.
Note: TriScatteredInterp is the recommended alternative to GRIDDATA as
it is generally more efficient.
ZI = GRIDDATA(X,Y,Z,XI,YI) fits a surface of the form Z = F(X,Y) to the
data in the (usually) nonuniformly-spaced vectors (X,Y,Z). GRIDDATA
interpolates this surface at the points specified by (XI,YI) to produce
ZI. The surface always goes through the data points. XI and YI are
usually a uniform grid (as produced by MESHGRID) and is where GRIDDATA
gets its name.
XI can be a row vector, in which case it specifies a matrix with
constant columns. Similarly, YI can be a column vector and it specifies
a matrix with constant rows.
[XI,YI,ZI] = GRIDDATA(X,Y,Z,XI,YI) also returns the XI and YI formed
this way (the results of [XI,YI] = MESHGRID(XI,YI)).
[...] = GRIDDATA(X,Y,Z,XI,YI,METHOD) where METHOD is one of
'linear' - Triangle-based linear interpolation (default)
'cubic' - Triangle-based cubic interpolation
'nearest' - Nearest neighbor interpolation
'v4' - MATLAB 4 griddata method
defines the type of surface fit to the data. The 'cubic' and 'v4'
methods produce smooth surfaces while 'linear' and 'nearest' have
discontinuities in the first and zero-th derivative respectively. All
the methods except 'v4' are based on a Delaunay triangulation of the
data.
If METHOD is [], then the default 'linear' method will be used.
[...] = GRIDDATA(X,Y,Z,XI,YI,METHOD,OPTIONS) specifies a cell array of
strings OPTIONS that were previously used by Qhull. Qhull-specific
OPTIONS are no longer required and are currently ignored. Support for
these options will be removed in a future release.
Example:
x = rand(100,1)*4-2; y = rand(100,1)*4-2; z = x.*exp(-x.^2-y.^2);
ti = -2:.25:2;
[xi,yi] = meshgrid(ti,ti);
zi = griddata(x,y,z,xi,yi);
mesh(xi,yi,zi), hold on, plot3(x,y,z,'o'), hold off
See also TriScatteredInterp, DelaunayTri, griddatan, delaunay,
interp2, meshgrid, delaunayn.
Reference page in Help browser
doc griddata
<griddata3> - Data gridding and hyper-surface fitting for 3-dimensional data.
GRIDDATA3 Data gridding and hyper-surface fitting for 3-dimensional data.
GRIDDATA3 will be removed in a future release. Use TriScatteredInterp instead.
W = GRIDDATA3(X,Y,Z,V,XI,YI,ZI) fits a hyper-surface of the form
W = F(X,Y,Z) to the data in the (usually) nonuniformly-spaced vectors
(X,Y,Z,V). GRIDDATA3 interpolates this hyper-surface at the points
specified by (XI,YI,ZI) to produce W.
(XI,YI,ZI) is usually a uniform grid (as produced by MESHGRID) and is
where GRIDDATA3 gets its name.
[...] = GRIDDATA3(X,Y,Z,V,XI,YI,ZI,METHOD) where METHOD is one of
'linear' - Tessellation-based linear interpolation (default)
'nearest' - Nearest neighbor interpolation
defines the type of surface fit to the data.
All the methods are based on a Delaunay triangulation of the data.
If METHOD is [], then the default 'linear' method will be used.
[...] = GRIDDATA3(X,Y,Z,V,XI,YI,ZI,METHOD,OPTIONS) specifies a cell
array of strings OPTIONS that were previously used by Qhull.
Qhull-specific OPTIONS are no longer required and are currently ignored.
Example:
x = 2*rand(5000,1)-1; y = 2*rand(5000,1)-1; z = 2*rand(5000,1)-1;
v = x.^2 + y.^2 + z.^2;
d = -0.8:0.05:0.8;
[xi,yi,zi] = meshgrid(d,d,d);
w = griddata3(x,y,z,v,xi,yi,zi);
Since it is difficult to visualize 4D data sets, use isosurface at 0.8:
p = patch(isosurface(xi,yi,zi,w,0.8));
isonormals(xi,yi,zi,w,p);
set(p,'FaceColor','blue','EdgeColor','none');
view(3), axis equal, axis off, camlight, lighting phong
Class support for inputs X,Y,Z,V,XI,YI,ZI: double
See also TriScatteredInterp, DelaunayTri, griddatan, delaunayn, meshgrid.
Reference page in Help browser
doc griddata3
<griddatan> - Data gridding and hyper-surface fitting (dimension >= 2).
GRIDDATAN Data gridding and hyper-surface fitting (dimension >= 2).
YI = GRIDDATAN(X,Y,XI) fits a hyper-surface of the form Y = F(X) to the
data in the (usually) nonuniformly-spaced vectors (X, Y). GRIDDATAN
interpolates this hyper-surface at the points specified by XI to
produce YI. XI can be nonuniform.
X is of dimension m-by-n, representing m points in n-D space. Y is of
dimension m-by-1, representing m values of the hyper-surface F(X). XI
is a vector of size p-by-n, representing p points in the n-D space
whose surface value is to be fitted. YI is a vector of length p
approximating the values F(XI). The hyper-surface always goes through
the data points (X,Y). XI is usually a uniform grid (as produced by
MESHGRID).
YI = GRIDDATAN(X,Y,XI,METHOD) where METHOD is one of
'linear' - Tessellation-based linear interpolation (default)
'nearest' - Nearest neighbor interpolation
defines the type of surface fit to the data.
All the methods are based on a Delaunay tessellation of the data.
If METHOD is [], then the default 'linear' method will be used.
YI = GRIDDATAN(X,Y,XI,METHOD,OPTIONS) specifies a cell array of strings
OPTIONS to be used as options in Qhull via DELAUNAYN.
If OPTIONS is [], the default options will be used.
If OPTIONS is {''}, no options will be used, not even the default.
Example:
X = 2*rand(5000,3)-1; Y = sum(X.^2,2);
d = -0.8:0.05:0.8; [x0,y0,z0] = meshgrid(d,d,d);
XI = [x0(:) y0(:) z0(:)];
YI = griddatan(X,Y,XI);
Since it is difficult to visualize 4D data sets, use isosurface at 0.8:
YI = reshape(YI, size(x0));
p = patch(isosurface(x0,y0,z0,YI,0.8));
isonormals(x0,y0,z0,YI,p);
set(p,'FaceColor','blue','EdgeColor','none');
view(3), axis equal, axis off, camlight, lighting phong
See also TriScatteredInterp, DelaunayTri, delaunayn, meshgrid.
Reference page in Help browser
doc griddatan
<TriScatteredInterp> - Scattered data interpolant
TriScatteredInterp Scattered data interpolant
TriScatteredInterp is used to perform interpolation on a scattered
dataset that resides in 2D/3D space. A scattered data set defined by
locations X and corresponding values V can be interpolated using a
Delaunay triangulation of X. This produces a surface of the form V = F(X).
The surface can be evaluated at any query location QX, using QV = F(QX),
where QX lies within the convex hull of X. The interpolant F always
goes through the data points specified by the sample.
F = TriScatteredInterp() Creates an empty scattered data interpolant.
This can subsequently be initialized with sample data points and values
(Xdata, Vdata) via F.X = Xdata and F.V = Vdata.
F = TriScatteredInterp(X, V) Creates an interpolant that fits a surface
of the form V = F(X) to the scattered data in (X, V). X is a matrix
of size mpts-by-ndim, where mpts is the number of points and ndim is
the dimension of the space where the points reside, ndim >= 2. V is a
column vector that defines the values at X, where the length of V
equals mpts.
F = TriScatteredInterp(X, Y, V) and F = TriScatteredInterp(X, Y, Z, V)
allow the data point locations to be specified in alternative column
Vector format when working in 2d and 3d.
F = TriScatteredInterp(DT, V) Uses the specified DelaunayTri DT as a
basis for computing the interpolant. DT is a Delaunay triangulation of
the scattered data locations, DT.X. The matrix DT.X is of size
mpts-by-ndim, where mpts is the number of points and ndim is the
dimension of the space where the points reside, 2 <= ndim <= 3. V is a
column vector that defines the values at DT.X, where the length of V
equals mpts.
F = TriScatteredInterp(..., METHOD) allows selection of the technique
used to interpolate the data, where METHOD is one of the following;
'natural' Natural neighbor interpolation
'linear' Linear interpolation (default)
'nearest' Nearest neighbor interpolation
The 'natural' method is C1 continuous except at the scattered data
locations. The 'linear' method is C0 continuous, and the 'nearest'
method is discontinuous.
Example 1:
x = rand(100,1)*4-2;
y = rand(100,1)*4-2;
z = x.*exp(-x.^2-y.^2);
% Construct the interpolant
F = TriScatteredInterp(x,y,z);
% Evaluate the interpolant at the locations (qx, qy), qz
% is the corresponding value at these locations.
ti = -2:.25:2;
[qx,qy] = meshgrid(ti,ti);
qz = F(qx,qy);
mesh(qx,qy,qz); hold on; plot3(x,y,z,'o'); hold off
Example 2: Edit the interpolant created in Example 1
to add/remove points or replace values
% Insert 5 additional sample points, we need to update both F.V and F.X
close(gcf)
x = rand(5,1)*4-2;
y = rand(5,1)*4-2;
v = x.*exp(-x.^2-y.^2);
F.V(end+(1:5)) = v;
F.X(end+(1:5), :) = [x, y];
% Replace the location and value of the fifth point
F.X(5,:) = [0.1, 0.1];
F.V(5) = 0.098;
% Remove the fourth point
F.X(4,:) = [];
F.V(4) = [];
% Replace the value of all sample points
vnew = 1.2*(F.V);
F.V(1:length(vnew)) = vnew;
TriScatteredInterp methods:
TriScatteredInterp provides subscripted evaluation of the
interpolant. It is evaluated in the same manner as evaluating a
function expressed in Monge's form.
QV = F(QX), evaluates the interpolant at the specified query
locations QX to produce the query values QV.
QV = F(QX, QY, ...) and QV = F(QX, QY, QZ, ...) allow the query
points to be specified in alternative column vector format when
working in 2D and 3D.
TriScatteredInterp properties:
X - Defines the locations of the scattered data points
V - Defines the value associated with each data point
Method - Defines the method used to interpolate the data
See also DelaunayTri, interp1, interp2, interp3, meshgrid.
Reference page in Help browser
doc TriScatteredInterp