MATLAB: Find nearest neighbors of a point

image analysis

Hi!
The green points in the figure are my reference points. I want to find the k nearest neighbors of red points to each green point.
I have the coordinates of all points.
Any suggestions?
Regards,
Anders Holmberg

Best Answer

Refer to the documentation of knnsearch & Nearest Neighbors.
Related Question