How to extract the diagonal of a given matrix?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How can I extract the diagonal of a given matrix with using size? I know we can do it directly with diag.
5 Commenti
José-Luis
il 7 Set 2017
Read the documentation on ind2sub() and sub2ind(). Having done that and using the fact that the diagonal of a square matrix is where I == J (keeping the nomenclature from the documentation) would allow you to solve your problem.
Risposta accettata
Più risposte (0)
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!