Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
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]

Risposta accettata

dpb
dpb il 1 Giu 2019
D=double(dec2bin(0:63,6))-'0';

Più risposte (0)

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by