Help with creating a certain 16x16 Matrix

5 ビュー (過去 30 日間)
Liam Åkerman
Liam Åkerman 2020 年 12 月 1 日
回答済み: Stephan 2020 年 12 月 1 日
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 日
Hint: read about the function zeros and ones and also about array indexing.

カテゴリ

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