nearestvertex
Query nearest polyshape
vertex
Syntax
Description
[
finds the vertex of a scalar vertexid
,boundaryid
,ind
] = nearestvertex(polyin
,x,y
)polyshape
object that is nearest to
each 2-D query point. The coordinates of the query points are specified in
x
and y
. The output contains three vectors:
vertexid
contains the row number inpolyin.Vertices
corresponding to the nearest vertex for each query point.boundaryid
contains the boundary index ofpolyin
corresponding to the nearest vertex for each query point.ind
contains the nearest vertex index in the boundaryboundaryid
for each query point.
[
specifies the query points as a 2-column matrix vertexid
,boundaryid
,ind
] = nearestvertex(polyin
,P
)P
whose first
column contains the x-coordinates and whose second column
contains the corresponding y-coordinates.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2018a