[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

## 29.4 Interpolation on Scattered Data

An important use of the Delaunay tessellation is that it can be used to
interpolate from scattered data to an arbitrary set of points. To do
this the N-simplex of the known set of points is calculated with
`delaunay`

, `delaunay3`

or `delaunayn`

. Then the
simplicies in to which the desired points are found are
identified. Finally the vertices of the simplicies are used to
interpolate to the desired points. The functions that perform this
interpolation are `griddata`

, `griddata3`

and
`griddatan`

.

__Function File:__`zi`=**griddata***(*`x`,`y`,`z`,`xi`,`yi`,`method`)__Function File:__[`xi`,`yi`,`zi`] =**griddata***(*`x`,`y`,`z`,`xi`,`yi`,`method`)Generate a regular mesh from irregular data using interpolation. The function is defined by

. The interpolation points are all`z`= f (`x`,`y`)`(`

. If`xi`,`yi`)`xi`,`yi`are vectors then they are made into a 2D mesh.The interpolation method can be

`"nearest"`

,`"cubic"`

or`"linear"`

. If method is omitted it defaults to`"linear"`

.**See also:**delaunay.

__Function File:__`vi`=**griddata3***(*`x`,`y`,`z`,`v``xi`,`yi`,`zi`,`method`,`options`)Generate a regular mesh from irregular data using interpolation. The function is defined by

. The interpolation points are all`y`= f (`x`,`y`,`z`)`xi`.The interpolation method can be

`"nearest"`

or`"linear"`

. If method is omitted it defaults to`"linear"`

.

__Function File:__`yi`=**griddatan***(*`x`,`y`,`xi`,`method`,`options`)Generate a regular mesh from irregular data using interpolation. The function is defined by

. The interpolation points are all`y`= f (`x`)`xi`.The interpolation method can be

`"nearest"`

or`"linear"`

. If method is omitted it defaults to`"linear"`

.

An example of the use of the `griddata`

function is

rand("state",1); x=2*rand(1000,1)-1; y=2*rand(size(x))-1; z=sin(2*(x.^2+y.^2)); [xx,yy]=meshgrid(linspace(-1,1,32)); griddata(x,y,z,xx,yy); |

[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |