How to find close values in matrix?
Show older comments
I want to find points which are close to each others, not alone.
for example, matrix = [ 1 1.1 7 17 0.99; 1 1.1 7 17 0.99;]
if I represent above matirx as *, (1,1) (1.1 , 1.1) (0.99,0.99) will be close to each others, like * in yellow circle.
Is there the way to find close values and erase others which are out of yellow circle ?

Answers (1)
If you use R2015a or later, ismembertol function may help.
By default, ismembertol looks for elements that are within tolerance, but it also can find rows of a matrix that are within tolerance. Something like,
LIA = ismembertol(A,B,tol,'ByRows',true)
C = A(LIA,:);
is worth trying. C will be a set of rows from A which matches to any of rows of B within the tolerance specified by tol.
Please be noted that the exact syntax could differ depending on how you define your variables.
Categories
Find more on Multirate Signal Processing 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!