How to reduce the executation time for the below operation
Show older comments
Hi,
Loc = [m*n] ; % size of X has 1500000*2
image_spots = [m*n] ; % size of X has 500000*2
distance_thresh = 0.5;
mask = false([length(Loc),1]);
tic,for i = 1:length(Loc)
if distance_thresh > min(pdist2(Loc(i,:),image_spots))
mask(i)= true;
end
end,toc;
the above for loop take atleast 12mins, is there a method or a way where i can reduce the times for the executation ?
1 Comment
darova
on 20 Apr 2020
Improve your chances on answer

Accepted Answer
More Answers (0)
Categories
Find more on Digital Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!