フィルターのクリア

The specified codeword length and message length are not valid with using encode hamming

5 ビュー (過去 30 日間)
soepblik
soepblik 2017 年 6 月 9 日
回答済み: Walter Roberson 2017 年 6 月 10 日
Hello,
i have this code to encode a 7 bit sequence to a 11 bit hamming code.
n = 11;
k = 7;
data = randi([0 1],k,1);
encData = encode(data,n,k,'hamming/binary');
but i get this error:
The specified codeword length and message length are not valid.
How can i solve this problem?

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 6 月 10 日
The formula works out such that you can only encode messages of length k if k = 2^n - n - 1 for some integer n. For example, messages of length 4 11 26 57 120 247 502 1013 2036 4083 ...

カテゴリ

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