How to convert binary number to decimal integer?

7 ビュー (過去 30 日間)
Hoat Vu
Hoat Vu 2017 年 9 月 10 日
回答済み: Jose Marques 2017 年 9 月 10 日
I'm trying to convert from binary number to decimal integer. I have some clues that I have to use predefined function bin2dec() or dec2bin(). Example: 00101101110 --> -657 an example was given by my professor. However, I have no idea how he converted from this binary number to -657. I try to do by hand, converting 00101101110, I got 366. Using bin2dec(), I got 366.
  1 件のコメント
David Goodmanson
David Goodmanson 2017 年 9 月 10 日
Hi Hoat,
It appears that twos complement or ones complement is involved here although I could not quite get there. Somebody will know.

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

回答 (1 件)

Jose Marques
Jose Marques 2017 年 9 月 10 日

カテゴリ

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