Description Usage Arguments Details Value Note See Also Examples
Utility function that creates a square matrix with a vector on the off-diagonal or extracts the specified off-diagonal vector.
1 | odiag(A, at = 0)
|
A |
either a vector or a matrix |
at |
which diagonal? |
If the first argument is a vector of length k, the result will be a
square matrix of rank k+at with the provided vector along the 'at'
diagonal. Positive values for 'at' place the vector above the
diagonal, negative values below the diagonal, and at=0
(the
default) places the vector on the diagonal.
A vector if argument A
is a matrix and a matrix if A
is
a vector.
odiag
is meant to capture some of the functionality of the
MATLAB function diag().
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.