nearestNeighbor
- :
ID =nearestNeighbor(TR, P)¶ - :
ID =nearestNeighbor(TR, x, y)¶ - :
ID =nearestNeighbor(TR, x, y, z)¶ - :
[ID, d] =nearestNeighbor(…)¶ Vertex closest to each query point (MATLAB triangulation / alphaShape).
TR is a triangulation-like struct with a
Pointsfield (also accepts delaunayTriangulation and alphaShape shims). Query points are rows of P, or separate coordinate columns. ID holds 1-based row indices intoTR.Points; d is Euclidean distance. Ties go to the highest index on small clouds (MATLAB R2026a triangulation). Large point sets use the engine__dsearchn__nearest-point search.