how to convert decimal values into 8bit binary sequence

9 ビュー (過去 30 日間)
Chandrashekar D S
Chandrashekar D S 2021 年 5 月 15 日
コメント済み: Chandrashekar D S 2021 年 5 月 15 日
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.

採用された回答

VBBV
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 ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by