I have a n X 2 matrix, but I want remove the points with a distance smaller than a threshold. And the data is random, which means the data position may be very far in the matrix but their distance is very close. Can anyone help me?
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a n X 2 matrix, but I wanna remove the points with a distance smaller than a threshold. And the data is random, which means the data position may be very far in the matrix but their distance is very close. Can anyone help me with an algorithm to deal with it?
댓글 수: 3
채택된 답변
Jan Orwat
2016년 6월 7일
dataOut = uniquetol(dataIn, tolerance, 'ByRows', true);
Above code should be a good starting point. In this case it would be 1-norm distance between points against given tolerance. Check uniquetol documentation for more information.
While it is not "Euklidean" 2-norm distance, in many cases should be good enough and it's very simple workaround.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!