Creating a vector from the diagonal values of a square matrix

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

 Respuesta aceptada

vector=diag(matrix);
check help diag for more detailed information.

Más respuestas (0)

Categorías

Preguntada:

el 30 de Jul. de 2014

Respondida:

el 30 de Jul. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by