| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
Interpolate scattered data
F = TriScatteredInterp()
F = TriScatteredInterp(X, V)
F = TriScatteredInterp(X, Y, V)
F
= TriScatteredInterp(X, Y, Z, V)
F = TriScatteredInterp(DT, V)
F = TriScatteredInterp(..., method)
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.
| X | 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. | |
| V | Column vector that defines the values at X, where the length of V equals mpts. | |
| DT | Delaunay triangulation of the scattered data locations | |
| method | natural | Natural neighbor interpolation |
| linear | Linear interpolation (default) | |
| nearest | Nearest-neighbor interpolation | |
| F | Creates an interpolant that fits a surface of the form V = F(X) to the scattered data. |
To evaluate the interpolant, express the statement in Monge's form V=F(x), V=F(x,y), or V=F(x,y,z).
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.
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');

| DelaunayTri |
| interp1 |
| interp2 |
| interp3 |
| meshgrid |
![]() | TriScatteredInterp class | trisurf | ![]() |

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 |