How do I generate a given Matrix in one command?

1 Ansicht (letzte 30 Tage)
Jacob Andréasson
Jacob Andréasson am 7 Nov. 2019
Bearbeitet: Walter Roberson am 10 Nov. 2019
I have to generate a matrix
A=[1 8 0 0 0 0;-1 2 8 0 0 0;0 -1 3 8 0 0; 0 0 -1 4 8 0;0 0 0 -1 5 8;0 0 0 0 -1 6
] writing a single command. How do i solve this exercise in best way?

Antworten (1)

Daniel M
Daniel M am 7 Nov. 2019
T = toeplitz([1 -1 0 0 0 0],[1 8 0 0 0 0])+diag(0:5)
  2 Kommentare
Jacob Andréasson
Jacob Andréasson am 7 Nov. 2019
Thank you so much!!!!
John D'Errico
John D'Errico am 7 Nov. 2019
Please try to not do homework assignments for people. Guide them to a solution if you wish. But just doing their homework teaches them nothing but that they can use answers to have their work done for them.

Melden Sie sich an, um zu kommentieren.

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