필터 지우기
필터 지우기

distance between array and matrix

조회 수: 2 (최근 30일)
Mireia Boneta Camí
Mireia Boneta Camí 2020년 11월 3일
답변: KSSV 2020년 11월 3일
Hello everybody,
I have a matrix P with size 3xN and another matrix T with size 3x480. The 3 rows that have the two matrix make reference to the x,y,z of each point. What I want to do is compute the distance of every of the 480 points of matrix T with all the points of matrix P, obtaining a D matrix of 480xN. Can i do this without fors and loops? Thanks.

채택된 답변

KSSV
KSSV 2020년 11월 3일
Read about pdist2.
A = rand(3,480) ;
d = pdist2(A',A') ; % required distances

추가 답변 (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