pdist2 output is larger than expected

조회 수: 3(최근 30일)
Pelajar UM
Pelajar UM 2021년 11월 15일
댓글: Pelajar UM 2021년 11월 15일
X= pdist2 (A,B, "chebychev")
A and B both are 3000x3 arrays (x,y,z data).
Why is X a 3000x3000 array rather than a 3000x1 array?
This seems to give the right answer though... why?
Z =diag(pdist2 (A,B, "chebychev"));

채택된 답변

Dave B
Dave B 2021년 11월 15일
pdist2 is providing all the pairwise distances. It compares row 1 of A with row 1 of B (Z(1,1)), then row 1 of A with row 2 of B (Z(1,2) and Z(2,1)), etc. Along the diagonal are the matching row cases.
  댓글 수: 3
Pelajar UM
Pelajar UM 2021년 11월 15일
Right. Thank you so much.

댓글을 달려면 로그인하십시오.

추가 답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by