Description Usage Arguments Details Value See Also Examples
Extract or replace the diagonal of a matrix, or construct a diagonal matrix.
1 |
x |
is an object of class FLMatrix or FLVector |
diag has three distinct usages: x is a FLMatrix, when it extracts the diagonal. x is a scalar (length-one FLVector) and the only argument, it returns a square identity matrix of size given by the scalar. x is a FLVector, either of length at least 2. This returns a square matrix with the given diagonal entries.
If x is a FLMatrix then diag(x) returns the diagonal of x as FLVector object. If x is FLVector, the value is a diagonal square FLMatrix with diagonal elements as given in FLVector.
diag
for corresponding R function reference.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.