Filter löschen
Filter löschen

Creating a Matrix including ones on diagonal

1 Ansicht (letzte 30 Tage)
Taner Cokyasar
Taner Cokyasar am 20 Nov. 2016
Kommentiert: Taner Cokyasar am 20 Nov. 2016
How can I create a matrix with the most shortcut way such as:
1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1
Thank you

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Nov. 2016
kron(eye(4),ones(1,5))

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by