eucilidean distance between two matrix

7 ビュー (過去 30 日間)
mukesh gupta
mukesh gupta 2016 年 11 月 9 日
回答済み: Image Analyst 2016 年 11 月 9 日
i have two matrix i want to find euclidean distance, for their similarity.

回答 (3 件)

KSSV
KSSV 2016 年 11 月 9 日
doc pdist2.

Walter Roberson
Walter Roberson 2016 年 11 月 9 日
It is only possible to find the euclidian distance between two matrices if the matrices are simple scalars or are vectors. If they are, for example, two dimensional histograms then euclidian distance does not apply.
  3 件のコメント
Walter Roberson
Walter Roberson 2016 年 11 月 9 日
Euclidian distance cannot be used in that situation.
Walter Roberson
Walter Roberson 2016 年 11 月 9 日
What you can do is reshape() the arrays to be vectors, after which the values can act as coordinates that you can apply Euclidean distance to. But it is not clear that would have same meaning as "Euclidean distance between matrices", as the second dimension of the matrices implies a relationship between the components that is not captured by pure component-wise distance measures.
Trying to find the Euclidean distance between matrices is much like trying to sort complex numbers: a complex number is not the same as two numbers together.

サインインしてコメントする。


Image Analyst
Image Analyst 2016 年 11 月 9 日
Not sure what your definition is, but perhaps do you mean the Euclidean distance between each corresponding pair of elements, and then maybe perhaps summing or taking of the mean of all of them?
distances = queryica - Z;
eucDistance = sum(distances); % or....
eucDistance = mean(distances(:));
If not, then maybe you can attach a diagram showing the distances between the matrices or pairs of points.

カテゴリ

Help Center および File ExchangeStatistics 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