How to create a matrix (64 X 6) with all numbers from 1 to 64, written by binary code?

4 ビュー (過去 30 日間)
Enrica Brunetti
Enrica Brunetti 2019 年 6 月 1 日
回答済み: dpb 2019 年 6 月 1 日
I try to use this function , but I have just a matrix(64 X 1)
D = [ ];
D = str2num(dec2bin(0:63, 6));
The solution must be :
D = [ 0 0 0 0 0 0
0 0 0 0 1 0
0 0 0 0 1 1
0 0 0 1 0 0
.................
1 1 1 1 1 1]

採用された回答

dpb
dpb 2019 年 6 月 1 日
D=double(dec2bin(0:63,6))-'0';

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by