MATLAB Answers

Silpa K
0

Distance between point and an array.

Asked by Silpa K
on 13 Oct 2019 at 16:07
Latest activity Commented on by Walter Roberson
on 13 Oct 2019 at 18:28
How can I find distance between a point and an n-array elements.

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Walter Roberson
on 13 Oct 2019 at 16:34

pdist2()

  2 Comments

Silpa K
on 13 Oct 2019 at 17:09
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
on 13 Oct 2019 at 18:28
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))

Sign in to comment.