decimal matrix to binary matrix

How can i convert decimal value of a matrix to binary value with corect position?

Respuestas (1)

Mischa Kim
Mischa Kim el 7 de Abr. de 2014
Kiran, try
B = arrayfun(@(ii,jj) {dec2bin(A(ii,jj))},repmat((1:size(A,1))',1,size(A,2)),repmat((1:size(A,2)),size(A,1),1));

1 comentario

Fouad BOUDJIRA
Fouad BOUDJIRA el 12 de Feb. de 2019
but this gives a cell input , that wont work with fprntf function !!!!!

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 7 de Abr. de 2014

Comentada:

el 12 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by