Given an nxn matrix A, how do I produce a lower triangular matrix with ones on the diagonal?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Given an nxn matrix A, how do I produce a lower triangular matrix with ones on the diagonal?
I tried
A = rand(n,n);
L = tril(A,1) + diag(ones(1, size(A,1))) ;
but it isn't working.
0 Commenti
Risposte (1)
Vedere anche
Categorie
Scopri di più su Operating on Diagonal Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!