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:
vertexidcontains the row number inpolyin.Verticescorresponding to the nearest vertex for each query point.boundaryidcontains the boundary index ofpolyincorresponding to the nearest vertex for each query point.indcontains the nearest vertex index in the boundaryboundaryidfor 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
