I have two sets each containing x,y coordinates for a series of points and codes respectively.
Considering the huge sizes of files I'm looking for an optimized way in Matlab to connect each point from the first set with the point from the second set that is the nearest based on Eucledian distance calculated with the help of coordinates values.
X Y
A=[155413 4564566; 156464 456585; ... ; n]
code X Y
B=[1001 155413 4564566; 1015 156464 456585; ... ; m]
The tricky part is they are of different length. For each point (line from A) I need the corresponding "code" variable from B as being found as the closest.
Thanks.
3
s to2
s (but not all of them) – Dan