powered by
Generate a diagonal matrix from a vector of the diagonal entries like.
gsi.diagGenerate(x)
a diagonal matrix.
a vector
K.Gerald v.d. Boogaart http://www.stat.boogaart.de
The difference to original diag is that it always gives a diagonal matrix and does nothing flawed in case of a length one vector.
diag
gsi.diagExtract, diag
gsi.diagExtract
diag(1:3) #gsi.diagGenerate(1:3) #gsi.diagGenerate(3) diag(3)
Run the code above in your browser using DataLab