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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by