MATLAB Function Reference | Search  Help Desk |
dsearch | See Also |
K = dsearch(x,y,TRI,xi,yi) K = dsearch(x,y,TRI,xi,yi,S)
K = dsearch(x,y,TRI,xi,yi)
returns the index of the nearest (x
,y
) point to the point (xi
,yi
). dsearch
requires a triangulation TRI
of the points x
,y
obtained from delaunay
.
K = dsearch(x,y,TRI,xi,yi,S)
uses the sparse matrix S
instead of computing it each time:
S = sparse(TRI(:,[1 1 2 2 3 3]),TRI(:,[2 3 1 3 1 2]),1,nxy,nxy)where
nxy = prod(size(x))
.
delaunay
Delaunay triangulation
tsearch
Search for enclosing Delaunay triangle
voronoi
Voronoi diagram