conversion of binary to decimal

6 vues (au cours des 30 derniers jours)
ablaze
ablaze le 29 Mar 2017
Commenté : Raed Alaa le 15 Nov 2021
binary=1011 decimal=bin2dec('binary')
this code shows a error - Error using bin2dec Binary string may consist only of characters 0 and 1
Is there is method for conversion of binary to decimal through passing a variable which consists binary numbers?????
  1 commentaire
Raed Alaa
Raed Alaa le 15 Nov 2021
code matlab how to convert from binary to decimal

Connectez-vous pour commenter.

Réponse acceptée

David Goodmanson
David Goodmanson le 29 Mar 2017
Modifié(e) : David Goodmanson le 29 Mar 2017
Hi ablaze, Your code has bin2dec trying to convert a string containing the word 'binary'. Try
a = '1011'
bin2dec(a)
  3 commentaires
ablaze
ablaze le 29 Mar 2017
thank u
Favour Oghenekowho
Favour Oghenekowho le 2 Juil 2021
Hi, how can I convert Hexadecimal to excess 3 code using Matlab?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by