Creating a vector from the diagonal values of a square matrix

95 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by