how to convert decimal values into 8bit binary sequence
6 ビュー (過去 30 日間)
古いコメントを表示
hello everyone,
I am trying to convert 14*3 matrix integer value to 8bit binary sequence in a same matrix dimension.
i am using dec2bin function to achieve that but the result is not the same i expected.
A=[8 7 1;
4 10 1;
9 7 1;
7 10 1;
9 6 1;
4 8 1;
10 10 1;
2 7 255;
8 3 255;
7 5 255;
4 4 255;
4 6 255;
1 3 255;
2 5 255];
b=dec2bin(A,8);
please help me with this.It will be really helpful.
Thanks in adavance.
0 件のコメント
採用された回答
VBBV
2021 年 5 月 15 日
%if true
for i = 1:length(A);
iwant{:,i} = dec2bin(A(i,:));
end
This results in a 1x14 cell array converted to binary characters
その他の回答 (0 件)
参考
カテゴリ
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!