Borrar filtros
Borrar filtros

how to convert decimal values into 8bit binary sequence

8 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

VBBV
VBBV el 15 de Mayo de 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

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by