Distance between point and an array.

조회 수: 8 (최근 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 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