Borrar filtros
Borrar filtros

Binary to Base_10

2 visualizaciones (últimos 30 días)
Kyle Langford
Kyle Langford el 8 de Abr. de 2022
Respondida: David Hill el 8 de Abr. de 2022
I am trying to convert 1100111.1101 from into decimal.
The two commands I am seeing are de2bi (not recomennded) and it recommends using int2bit instead, but I cannot seem to get it to work. I know how to do this by hand and get 103.8125, but I am trying to get more MATLAB practice.
I can't seem to find much support on this.

Respuesta aceptada

David Hill
David Hill el 8 de Abr. de 2022
a='1100111.1101';
b=regexp(a,'[.]','split');
A=sum(flip(b{1}-'0').*(2).^(0:length(b{1})-1))+sum((b{2}-'0').*(2).^-(1:length(b{2})));

Más respuestas (0)

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