calcul.io
math playground
New
calculation
Help
Instructions
Examples
Functions
Constants
Display Debug info
Functions
Matrix
diag
diag
diag(x)
diag(x, k)
Try it yourself:
$1
diag(1:3)
$2
diag(1:3, 1)
$3
a = [1, 2, 3; 4, 5, 6; 7, 8, 9]
$4
diag(a)
See also:
concat
det
identity
inv
ones
range
size
squeeze
subset
trace
transpose
zeros
All functions