Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

TriScatteredInterp - Class: TriScatteredInterp

Interpolate scattered data

Syntax

F = TriScatteredInterp()
F = TriScatteredInterp(X, V)
F = TriScatteredInterp(X, Y, V)
F = TriScatteredInterp(X, Y, Z, V)
F = TriScatteredInterp(DT, V)
F = TriScatteredInterp(..., method)

Description

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. The column vector V 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 2-D and 3-D.

F = TriScatteredInterp(DT, V) uses the specified DelaunayTri object DT as a basis for computing the interpolant. 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 method used to interpolate the data.

Inputs

XMatrix of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside.
VColumn vector that defines the values at X, where the length of V equals mpts.
DTDelaunay triangulation of the scattered data locations
methodnaturalNatural neighbor interpolation
linearLinear interpolation (default)
nearestNearest-neighbor interpolation

Outputs

F Creates an interpolant that fits a surface of the form V = F(X) to the scattered data.

Evaluation

To evaluate the interpolant, express the statement in Monge's form V=F(x), V=F(x,y), or V=F(x,y,z).

Definitions

The Delaunay triangulation of a set of points is a triangulation such that the unique circle circumscribed about each triangle contains no other points in the set.

Examples

Create a data set:

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). The corresponding value at these locations is qz .

ti = -2:.25:2;
[qx,qy] = meshgrid(ti,ti);
qz = F(qx,qy);
mesh(qx,qy,qz);
hold on;
plot3(x,y,z,'o');

See Also

DelaunayTri
interp1
interp2
interp3
meshgrid
  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS