Creating a vector from the diagonal values of a square matrix

34 vues (au cours des 30 derniers jours)
Kourosh
Kourosh le 30 Juil 2014
Hello,
Does anybody know how I can read the diagonal values of a square matrix and create a vector (1:n) from those values?
Cheers,
Cyrus

Réponse acceptée

Ahmet Cecen
Ahmet Cecen le 30 Juil 2014
vector=diag(matrix);
check help diag for more detailed information.

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