21.3.1 Diagonal Matrix Functions

inv and pinv can be applied to a diagonal matrix, yielding again a diagonal matrix. det will use an efficient straightforward calculation when given a diagonal matrix, as well as cond. The following mapper functions can be applied to a diagonal matrix without converting it to a full one: abs, real, imag, conj, sqrt. A diagonal matrix can also be returned from the balance and svd functions. The sparse function will convert a diagonal matrix efficiently to a sparse matrix.

© 1996–2020 John W. Eaton
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://octave.org/doc/v5.2.0/Diagonal-Matrix-Functions.html