Is possible to make radius flexible within rangesearch function?
显示 更早的评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!