I have code like this :
Ind = [];distTh = 5; A = [1;7;14];B = [2;5;8;10]; for i = 1:size(A,1) for j = 1: size(B,1) Distance = abs(B(j) - A(i)); if Distance < distTh Ind = [Ind j]; end endend
My questions : How to make elements in array 'B' no longer compared to array 'A' (remove index 'B'), if it is already in 'Ind' ?
Thank you very much.
Best Answer