Constuctiing special array (like binary)
이전 댓글 표시
Hi, I'am new to matlab and I want to make an nxn matrix containing as first row zeros and as last row ones. The other rows should be like binary digits.
Example with n=4:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Thank you!!
댓글 수: 2
Matt J
2013년 12월 4일
The matrix you've shown is not nxn. It is 2^n x n.
Dimitris Sideratos
2013년 12월 5일
채택된 답변
추가 답변 (3개)
Dimitris Sideratos
2014년 1월 19일
0 개 추천
댓글 수: 2
Jan
2014년 1월 19일
Please open a new thread for a new question.
Dimitris Sideratos
2014년 1월 20일
Jos (10584)
2014년 1월 20일
편집: Jos (10584)
2014년 1월 20일
Take a look at COMBN:
USe like this:
N = 2 ; M = 3 ;
combn(0:M-1,N)
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!