Decimal to binary conversion

3 ビュー (過去 30 日間)
Shailee Yagnik
Shailee Yagnik 2019 年 11 月 25 日
コメント済み: Shailee Yagnik 2019 年 11 月 25 日
Is there a way where i can convert 3 to '011' instead of just '11'.
I need it to compare the reveived code error.
This is what i want to achieve.
Eg: u='111' % real code
v='011' %received code;
Hamming_distance= 1.

採用された回答

Image Analyst
Image Analyst 2019 年 11 月 25 日
Did you check the documentation for dec2bin()?
Try this:
d2b = dec2bin(3, 3); % returns '011'
  1 件のコメント
Shailee Yagnik
Shailee Yagnik 2019 年 11 月 25 日
Yes I did, but i guess i missed out on that! Thanks for the help!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by