| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
dsearch will be removed in a future release. Use DelaunayTri/nearestNeighbor instead.
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 into x and y of the nearest point to the point (xi,yi). dsearch requires a triangulation TRI of the points x,y obtained using delaunay. If xi and yi are vectors, K is a vector of the same size.
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)).
DelaunayTri, delaunay, voronoi
![]() | drawnow | dsearchn | ![]() |

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 |