decimal matrix to binary matrix

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

回答 (1 件)

Mischa Kim
Mischa Kim 2014 年 4 月 7 日

0 投票

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 件のコメント

Fouad BOUDJIRA
Fouad BOUDJIRA 2019 年 2 月 12 日
but this gives a cell input , that wont work with fprntf function !!!!!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2014 年 4 月 7 日

コメント済み:

2019 年 2 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by