convert binary vector value into decimal

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 日

1 投票

Raza, use
bin2dec(num2str(a))
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 26 日
編集済み: Azzi Abdelmalek 2014 年 2 月 26 日

0 投票

a= [0 0 1 0 1 0 1 1];
b=bin2dec(sprintf('%d',a))

カテゴリ

タグ

質問済み:

2014 年 2 月 26 日

回答済み:

2014 年 2 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by