This function compute the nearest neighbours (by Euclidean distance) to a set of given points from a set of candidate points.
In this tool, exclusively the really nearest point will be calculated
without using special algorithms (delaunay, brute search etc. ) and also without a loop. Therefore, the function is very fast but
supports only a limited set of canditate and given points in 3D. For very large input data it can be lead to out of memory errors because the maximum adressable memory area of 32-Bit operation systems is located about 2 GByte (or 3 GByte with a change in the boot of the windows operation system).
an N1 x 3 matrix of cantitate_points
an N2 x 3 matrix of given_points (N1 and N2 can be different)
an N2 x 1 matrix (column) with the numbers of the nearest neighbour points to each canditate point. (The number of a row in the nearest neighbour matrix is equivalent to the number of the given point in the canditate points matrix)
Andreas Richter (2021). nearest_neighbour_3D (https://www.mathworks.com/matlabcentral/fileexchange/24723-nearest_neighbour_3d), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!