Convert binary to decimat
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Walter Roberson
2017-7-25
bin2dec(num2str(A, '%08d'))
Note: A needs to be a column vector for this to work.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!