How to find Hamming Distance ?

42 ビュー (過去 30 日間)
Ammy
Ammy 2018 年 1 月 25 日
コメント済み: Ammy 2018 年 1 月 26 日
I have a set of different codewords , how I separate those code words having the same hamming distance? Also D=pdist(A,'hamming') does not work in my case , If A is 1 1 1 2; 1 2 1 2 I want to calculate no. of position where they differ.
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 1 月 25 日
Does it happen to be the case that all of your values are either 1 or 2 ? (Or, more generally, that you have exactly two different values and the two values are numerically 1 apart ?)

サインインしてコメントする。

採用された回答

the cyclist
the cyclist 2018 年 1 月 25 日
編集済み: the cyclist 2018 年 1 月 25 日
The Hamming distance is the fraction of positions that differ. If you want the number of positions that differ, you can simply multiply by the number of pairs you have:
numberPositionsDifferent = size(A,2)*pdist(A,'hamming');
If that's not what you meant, you might want to give more information (including the answer to Walter's questions in his comment.)
  1 件のコメント
Ammy
Ammy 2018 年 1 月 26 日
Thank you very much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHamming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by