convert binary vector value into decimal

15 visualizaciones (últimos 30 días)
Raza Ali
Raza Ali el 26 de Feb. de 2014
Respondida: Andrei Bobrov el 26 de Feb. de 2014
i have
a= [0 0 1 0 1 0 1 1]
i want to convert it, into decimal value 43

Respuestas (3)

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

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

Andrei Bobrov
Andrei Bobrov el 26 de Feb. de 2014
polyval(a,2)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by