Filter löschen
Filter löschen

Distance between point and an array.

2 Ansichten (letzte 30 Tage)
Silpa K
Silpa K am 13 Okt. 2019
Kommentiert: Walter Roberson am 13 Okt. 2019
How can I find distance between a point and an n-array elements.

Antworten (1)

Walter Roberson
Walter Roberson am 13 Okt. 2019
pdist2()
  2 Kommentare
Silpa K
Silpa K am 13 Okt. 2019
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 am 13 Okt. 2019
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))

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by