문제

I have two equal length strings containing 1's and 0's. Each string is 128-bits long, and I want to calculate the Hamming distance between them. What's the best way I can go about doing this?

e.g. a='1000001' and b='1110001' --> dist=Hamming(a,b);

도움이 되었습니까?

해결책

Use pdist with the hamming parameter.

다른 팁

dist = sum(a ~= b);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top