Distance between point and an array.

3 ビュー (過去 30 日間)
Silpa K
Silpa K 2019 年 10 月 13 日
コメント済み: Walter Roberson 2019 年 10 月 13 日
How can I find distance between a point and an n-array elements.

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 10 月 13 日
pdist2()
  2 件のコメント
Silpa K
Silpa K 2019 年 10 月 13 日
Sir,using this function not getting.
For example a point 0.345 and an array=[0.0456,0.123,0.567,0.678,0.421]
I need to calculate distance between the point and the array.
Walter Roberson
Walter Roberson 2019 年 10 月 13 日
pdist2(point, array.')
However, for the simple 1D case, perhaps you want
abs(point - array)
and my guess is you want
min(abs(point - array))

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

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by