필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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 CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by