Fast extraction of matrix diagonal
qdiag(x)
x
The matrix to extract the diagonal from
Note this function can only be used for extraction
A vector with the diagonal elements
Claus Ekstrom <claus@rprimer.dk>