Distance between point and an array.

8 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by