convert binary vector value into decimal

15 ビュー (過去 30 日間)
Raza Ali
Raza Ali 2014 年 2 月 26 日
回答済み: Andrei Bobrov 2014 年 2 月 26 日
i have
a= [0 0 1 0 1 0 1 1]
i want to convert it, into decimal value 43

回答 (3 件)

Mischa Kim
Mischa Kim 2014 年 2 月 26 日
Raza, use
bin2dec(num2str(a))

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 26 日
編集済み: Azzi Abdelmalek 2014 年 2 月 26 日
a= [0 0 1 0 1 0 1 1];
b=bin2dec(sprintf('%d',a))

Andrei Bobrov
Andrei Bobrov 2014 年 2 月 26 日

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by