How to create a matrix?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all, I am trying to create a matrix (101x101) like this :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159869/image.jpeg)
Can anyone help me with the code please?
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 2 Avr 2016
Modifié(e) : Azzi Abdelmalek
le 2 Avr 2016
n=4 % in your case use n=101
out=tril(2*ones(n),-1)
Plus de réponses (0)
Voir également
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!