Hello,
I am using [IDX,D] = knnsearch(y,y,'K',2,'NSMethod','exhaustive') to find the nearest neighbor to each point of y in y (excluding obviously the same point, hence the 2 in 'K').
The algorithm returns that point 34 is the nearest neighbor of point 72, but when one goes to point 72, its nearest neighbor is point 124 (I guess it should be point 34). Any clue why this happens?
Best Answer