Borrar filtros
Borrar filtros

Convert binary to decimat

2 visualizaciones (últimos 30 días)
Luqman Saleem
Luqman Saleem el 25 de Jul. de 2017
Respondida: Walter Roberson el 25 de Jul. de 2017
I have matrix A as:
A=
[11
101
110]
11, 101 and 110 here are in decimal system. But I want MATLAB to consider 11 as bits and convert them into decimals. i.e. 11=3, 101=5 and 110=6. Is there any way of doing this on a matrix of any dimension which have elements like this?

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Jul. de 2017
bin2dec(num2str(A, '%08d'))
Note: A needs to be a column vector for this to work.

Más respuestas (1)

James Tursa
James Tursa el 25 de Jul. de 2017

Categorías

Más información sobre MATLAB 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