how pdist2 works
Show older comments
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!
Answers (0)
Categories
Find more on Hamming 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!