mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
520 B
520 B
Function diag
Create a diagonal matrix or retrieve the diagonal of a matrix
diag(v) diag(v, k) diag(X) diag(X, k)
TODO: more documentation on diag
Parameters
| Parameter | Type | Description |
|---|---|---|
x |
Matrix | Array | |
k |
Number | BigNumber |
Returns
| Type | Description |
|---|---|
| Matrix | Array | matrix |