Finding similarity between 2 matrices

25 ビュー (過去 30 日間)
Gayathri Nayar
Gayathri Nayar 2019 年 10 月 15 日
編集済み: Gayathri Nayar 2019 年 10 月 15 日
I have two matrices, of different sizes (say, 42*42 and 40 *40). The matrix has entries of only zero and one. I want a measure that could quantize the amount of similarity between these two matrices.
I have tried corr2 but output will not be obtained since the 2 matrices are of different size. Even after making the size same by appending zeros, the value of correlation gives small values.
If these matrices are adjacency matrices obtained from different graphs. I want to find out the amount of similarity between these matrices.

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 10 月 15 日
編集済み: KALYAN ACHARJYA 2019 年 10 月 15 日
I have two matrices, of different sizes (say, 42*42 and 40 *40). I want a measure that could quantize the amount of similarity between these two matrices.
One way, (Some extent)
A=randi(10,[42,42]);
B=randi(10,[40,40]);
mse_data=mse(A(1:40,1:40),B); % Please note (1:40,1:40),B)
Or Pad the B with 2 lines zeros and do compare
More less value of mse_data, more similar
  5 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 10 月 15 日
編集済み: KALYAN ACHARJYA 2019 年 10 月 15 日
Are you looking for images?
See here SSIM also
Gayathri Nayar
Gayathri Nayar 2019 年 10 月 15 日
it is not purely images. I have said it as an example only. i want to find how much similar are two matrices with zero and ones as its entries.

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

Community Treasure Hunt

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

Start Hunting!

Translated by