How to create matrix 10x10 with same diagonal vector and empry value

5 vues (au cours des 30 derniers jours)
Ira Wal
Ira Wal le 28 Nov 2020
Commenté : Ira Wal le 7 Déc 2020
I am new to matlab and i need to create a 10x10 matrix, which consists of same number by diagonal, triangular matrix and empty values (like on image)

Réponse acceptée

Stephen23
Stephen23 le 28 Nov 2020
M = toeplitz([2,1,zeros(1,8)])
M = 10×10
2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 1 2

Plus de réponses (0)

Catégories

En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by