conversion of binary to decimal

9 次查看(过去 30 天)
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?????

采纳的回答

David Goodmanson
David Goodmanson 2017-3-29
编辑:David Goodmanson 2017-3-29
Hi ablaze, Your code has bin2dec trying to convert a string containing the word 'binary'. Try
a = '1011'
bin2dec(a)
  3 个评论
Favour Oghenekowho
Hi, how can I convert Hexadecimal to excess 3 code using Matlab?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by