MATLAB Function Reference |

Data gridding and hypersurface fitting for 3-D data

**Syntax**

**Description**

```
w = griddata3(x, y, z, v, xi, yi, zi)
```

fits a hypersurface of the form to the data in the (usually) nonuniformly spaced vectors (`x`

, `y`

, `z`

, `v`

). `griddata3`

interpolates this hypersurface at the points specified by (`xi`

,`yi`

,`zi`

) to produce `w`

. `w`

is the same size as `xi`

, `yi`

, and `zi`

.

(`xi`

,`yi`

,`zi`

) is usually a uniform grid (as produced by `meshgrid`

) and is where `griddata3`

gets its name.

```
w = griddata3(...,method)
```

defines the type of surface that is fit to the data, where `method`

is either:

`'linear'` |
Tesselation-based linear interpolation (default) |

`'nearest'` |
Nearest neighbor interpolation |

**Algorithm**

The `griddata3`

methods are based on a Delaunay triangulation of the data that uses Qhull [2]. This triangulation uses the Qhull joggle option (`'QJ'`

). For information about Qhull, see http://www.geom.umn.edu/software/qhull/. For copyright information, see http://www.geom.umn.edu/software/download/COPYING.html.

**See Also**

`delaunayn`

, `griddata`

, `griddatan`

, `meshgrid`

**Reference**

[1] Barber, C. B., D.P. Dobkin, and H.T. Huhdanpaa, "The Quickhull Algorithm for
Convex Hulls," *ACM Transactions on Mathematical Software*, Vol. 22, No. 4,
Dec. 1996, p. 469-483. Available in HTML format at
http://www.acm.org/pubs/citations/journals/toms/1996-22-4/p469-barber/
and in PostScript format at ftp://geom.umn.edu/pub/software/qhull-96.ps.

[2] National Science and Technology Research Center for Computation and Visualization of Geometric Structures (The Geometry Center), University of Minnesota. 1993.

griddata | griddatan |