How to combine two binary columns
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ennio Malvati
el 12 de Oct. de 2022
Editada: Fangjun Jiang
el 12 de Oct. de 2022
I have a table like this: [0 1 0 0 1, 1 0 1 1 0]
and i want to combine binary the two columns in order to obtain a column like this:
[01, 10, 01, 01, 10]. Ho can I do this?
0 comentarios
Respuesta aceptada
Fangjun Jiang
el 12 de Oct. de 2022
Editada: Fangjun Jiang
el 12 de Oct. de 2022
a=[0 1 0 0 1;1 0 1 1 0]
s=sprintf('%d%d\n',a(:))
Or
b=dec2bin(a)
c=reshape(b,2,[])
d=c'
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!