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
Jan Orwat 2016 年 6 月 7 日
編集済み: Jan Orwat 2016 年 6 月 7 日
Distance between datapoints themselves I assume
binbin cui
binbin cui 2016 年 6 月 7 日
The distance between any two points should be detected.

サインインしてコメントする。

採用された回答

Jan Orwat
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.
  2 件のコメント
binbin cui
binbin cui 2016 年 6 月 7 日
Thank you very much. But I just find another algorithm to implement this calculation. I will use the D=pdist() to get all the possible distances.then find the values below the threshold in the D matrix. Use the index of target values to infer their pairing in original matrix.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by