MATLAB: How to arrange ascending order closest points in 1000 data set without using ‘knnsearchtree’

closest pointknsearch

I have 1000 points which are consists in 3-D coordinates. How I can find for example first 500 closest points for every points? With 'knnsearchtree' it is reallyeasy but I couldn't do it bymeyself.

Best Answer

You could use pdist() in combination with mink() .
This does not scale up well, but with 1000 points it should be do-able.