convert binary vector value into decimal

15 Ansichten (letzte 30 Tage)
Raza Ali
Raza Ali am 26 Feb. 2014
Beantwortet: Andrei Bobrov am 26 Feb. 2014
i have
a= [0 0 1 0 1 0 1 1]
i want to convert it, into decimal value 43

Antworten (3)

Mischa Kim
Mischa Kim am 26 Feb. 2014
Raza, use
bin2dec(num2str(a))

Azzi Abdelmalek
Azzi Abdelmalek am 26 Feb. 2014
Bearbeitet: Azzi Abdelmalek am 26 Feb. 2014
a= [0 0 1 0 1 0 1 1];
b=bin2dec(sprintf('%d',a))

Andrei Bobrov
Andrei Bobrov am 26 Feb. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by