Help with creating a certain 16x16 Matrix

Hi, I need help with creating the following matrix:
(I know that I probably could create it manually by writing A = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; etc.], but this seems very unpractical. There must be a better way.)
The empty squares are just 'zeros' and the black squares are 'ones', for example the 5th row would be: [...;0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 0; ...]
I'm grateful for any help.

답변 (1개)

Stephan
Stephan 2020년 12월 1일

0 개 추천

Hint: read about the function zeros and ones and also about array indexing.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2020년 12월 1일

답변:

2020년 12월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by