필터 지우기
필터 지우기

Calculate distance of one 5D point from all points of 5D matrix

조회 수: 7 (최근 30일)
abaza
abaza 2018년 7월 24일
댓글: abaza 2018년 7월 24일
Dear All, could someone help me to calculate the distance between a 5 dimensional point from all 5 dimensional points of a matrix? Namely, I have a point A within a vector of size 1x5 and I would like to calculate 1000 distances between this point from a matrix 1000x5 (1000 points).
Thank you in advance

채택된 답변

Ali Aghaeifar
Ali Aghaeifar 2018년 7월 24일
I think you are looking for pdist2
A = rand(1,5);
B = rand(1000,5);
C = pdist2(A, B);
  댓글 수: 1
abaza
abaza 2018년 7월 24일
Thanks! I did not know that pdist2 works with different size vectors/matrices!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by