binary matrix to decimal number
1 回表示 (過去 30 日間)
古いコメントを表示
Abduellah Elbakoush
2022 年 1 月 21 日
コメント済み: Abduellah Elbakoush
2022 年 1 月 21 日
I have binary matrix the dimensions of matrix (1*8) like this
1 0 1 1 0 0 1 0
I want to put that matrix into another matrix the dimensions of new matrix is ( 1*1) like this
10110010
then I want to conver into decimel number like this
178
Can you help me to do this problem
0 件のコメント
採用された回答
その他の回答 (1 件)
Simon Chan
2022 年 1 月 21 日
Try this:
A = logical([1 0 1 1 0 0 1 0]);
B = bin2dec(num2str(A))
1 件のコメント
yanqi liu
2022 年 1 月 21 日
a = [1 0 1 1 0 0 1 0 ];
b = strrep(num2str(a), ' ', '')
c = bin2dec(b)
参考
カテゴリ
Help Center および File Exchange で Import, Export, and Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!