distance between two matrices

조회 수: 4 (최근 30일)
madhuri sachane
madhuri sachane 2012년 5월 18일
댓글: sweta singh 2014년 9월 9일
I have to compute the hamming distance between two matrices.
a=[240*7]; b=[240*7]; dist=hamming (a,b);
but this code shows error.
what i do? I need the solution.

채택된 답변

Junaid
Junaid 2012년 5월 18일
hamming is not for hamming distance I guess. What is the type of input you want to compute the hamming distance.
Hamming distance is usually calculated between character array or binary array. For binary array it is very simple and straight forward.
For binary array sum of absolute difference can give you hamming distance.
For example.
a = [1 0 0 1];
b = [1 1 1 1];
h_d = sum(abs(a-b));
  댓글 수: 1
sweta singh
sweta singh 2014년 9월 9일
What if i have to find the hamming distance between two rows of a binary array?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Hamming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by