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?
3 ビュー (過去 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!