Hello everyone. I converted 4 into binary and got 100 . my problem is that i want to use this 100 as a decimal but the matlab is obviously treating it as a binary number. Please help

1 visualización (últimos 30 días)
please help

Respuesta aceptada

Mischa Kim
Mischa Kim el 28 de Feb. de 2014
Editada: Mischa Kim el 28 de Feb. de 2014
You could
my_bindec = str2num(dec2bin(4))/5
ans =
20

Más respuestas (1)

lvn
lvn el 28 de Feb. de 2014
The following code gives you a decimal 100:
str2double(dec2bin(4))

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by