binary to decimal conversion.......need ans immidiately plzzzzzzzzzzz
1 回表示 (過去 30 日間)
古いコメントを表示
hello! I have a string of binary suppose a binary string of 2000 bit. A=[0 0 0 0 1 1 0 1 1 0 1 0 0 ............so on] I wana to convert it into decimals. though i use function B=bin2dec(A, 8). but it returns me error. i wana to convert each 8-bits into decimal number. plz help me how should i do it. Thanks
0 件のコメント
採用された回答
その他の回答 (2 件)
RoJo
2011 年 5 月 6 日
bin2dec takes a binary string as input argument.
So you can convert A into 8 bit strings and then call bin2dec
For example A1 = '00001101' B1 = bin2dec(A1)
0 件のコメント
Andrei Bobrov
2011 年 5 月 6 日
variant
bin2dec(num2str(reshape([A,zeros(1,8-rem(length(A),8))],[],8)))
1 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!