decimal matrix to binary matrix

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

Antworten (1)

Mischa Kim
Mischa Kim am 7 Apr. 2014

0 Stimmen

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 Kommentar

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

Melden Sie sich an, um zu kommentieren.

Kategorien

Gefragt:

am 7 Apr. 2014

Kommentiert:

am 12 Feb. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by