Azzera filtri
Azzera filtri

how to convert decimal values into 8bit binary sequence

8 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

VBBV
VBBV il 15 Mag 2021
%if true
for i = 1:length(A);
iwant{:,i} = dec2bin(A(i,:));
end
This results in a 1x14 cell array converted to binary characters

Più risposte (0)

Categorie

Scopri di più su Data Type Conversion in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by