Hello everyone,
I meet an urgent situation, I have around 300000 points which has x and y coordinate and I want to find all neighbors near the specified a set of points which about 10000 points with flexible radius.
I tried to use 'rangesearch' function, but the radius in that function is fixed. Then I try to use for loop to get the result, but the execution time is too long because my data size.
My for loop is written as below
%radius is a vector which length is 10000; data is a 300000-by-2 matrix,track is a 10000-by-2 matrix.
for i=1:10002 a=rangesearch(data,track,radius(i)); idx(i)=a(i); end
So each track match a radius, and those 300000 points cut by different circle which has corresponding radius and center(track).
Anybody can help me simplified the code?
Best Answer