# How to reliable find the distance between matrices?

조회 수: 1(최근 30일)
Serbring 2020년 12월 1일
답변: Pratyush Roy 2021년 4월 1일
Dear all,
I need to compute the distance among matrices. These matrices describe the usage of vehicle and they report the joint probability distribution between two variables. The variables are binned.The matrix contains positive numbers. The distance metric would provide an information about the dissimilarity between the usage of two vehicles. I have tried as the following:
m=zeros(3,15,16);
m(1,13,12)=1;
m(2,12,13)=1;
m(3,1,1)=1;
norm(squeeze(m(1,:,:))-squeeze(m(2,:,:)))
norm(squeeze(m(1,:,:))-squeeze(m(3,:,:)))
norm(squeeze(m(1,:,:))-squeeze(m(2,:,:)))
The three matrices contains the same number but it is positioned in a different position. For matrix 1 (m(1,:,:)) and 2 (m(2,:,:)), the number 1 is located in a similar position, but in a very different position than matrix 3 (m(3,:,:)). The matrix 3 is the consequence of a very different vehicle usage than the others. lThis made me think that is necessary a different distance metric . Is there any other which you may reccomend for my purpose?
thank you.
best regards.

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

### 답변(1개)

Pratyush Roy 2021년 4월 1일
Hi,
The function pdist2 might be used to find distances between matrices.
Hope this helps!

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

### 범주

Find more on Descriptive Statistics in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by