how to extract the diagonal entries out of a matrix

Edward edatva at gmail.com
Fri Feb 6 12:01:02 CST 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090206/91a349c6/attachment.html 


More information about the Help-octave mailing list