how pdist2 works

I have two mat files, template1_1.mat and template1_2.mat.
template1_1.mat :
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1
template1_2.mat:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0
0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1
When I calculate hamming distance between these two files using this code:
HD = pdist2(template1_1,template1_2,'hamming');
Then the output is 0.0057
Can anyone explain to me how it works? Thank in advance!

回答 (0 件)

質問済み:

2018 年 4 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by