help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to extract the diagonal entries out of a matrix


From: Edward
Subject: how to extract the diagonal entries out of a matrix
Date: Fri, 6 Feb 2009 13:01:02 -0500

Hi,

For example, there is a matrix like:

[ 1 2 3 4
  5 6 7 8
  3 5 7 0
  4 8 2 5 ]
and I want to get the diagonal elements out of the matrix and make into a vector: [ 1 6 7 5]  .

I know I could write some lines to do it, but I just want to know if there is a built-in function can do the job. Thank you.

--
Edward

reply via email to

[Prev in Thread] Current Thread [Next in Thread]