Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Interpolate 2-D or 3-D scattered data

`vq = griddata(x,y,v,xq,yq)`

`vq = griddata(x,y,z,v,xq,yq,zq)`

`vq = griddata(___,method)`

fits
a surface of the form `vq`

= griddata(`x`

,`y`

,`v`

,`xq`

,`yq`

)*v* = *f*(*x*,*y*) to
the scattered data in the vectors `(x,y,v)`

. The `griddata`

function
interpolates the surface at the query points specified by `(xq,yq)`

and
returns the interpolated values, `vq`

. The surface
always passes through the data points defined by `x`

and `y`

.

specifies the interpolation method used to compute `vq`

= griddata(___,`method`

)`vq`

using any
of the input arguments in the previous syntaxes. `method`

can be
`'linear'`

, `'nearest'`

,
`'natural'`

, `'cubic'`

, or
`'v4'`

. The default method is `'linear'`

.

Qhull-specific options are no longer supported. Remove the
`options`

argument from all instances in your code that
pass it to `griddata`

.

In a future release, `griddata`

will not accept any
input vectors of mixed orientation. In addition, the following syntaxes will
be
removed:

```
[Xq,Yq,Vq] = griddata(x,y,v,xq,yq)
[Xq,Yq,Vq] = griddata(x,y,v,xq,yq,
````method`

)

`ndgrid`

or `meshgrid`

before
calling `griddata`

.