Answer the question
In order to leave comments, you need to log in
How to calculate Hamming distance in matlab?
Hello. Need a little help. There are two codes derived from binary images: 71113773FECCCCC0 and 31111333ECDCEECC . How to calculate Haming distance between these two hex values?
Answer the question
In order to leave comments, you need to log in
X = '71113773FECCCCC0';
Y = '31111333ECDCEECC';
%%
xv = double(hexToBinaryVector(X, length(X)*4));
yv = double(hexToBinaryVector(Y, length(Y)*4));
%%
D = pdist([xv; yv])
D = pdist([xv; yv], 'cityblock')
D = pdist([xv; yv], 'hamming')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question