DiagonalMatrix

DiagonalMatrix[list]
gives a matrix with the elements of list on the leading diagonal, and elsewhere.

DiagonalMatrix[list,k]
gives a matrix with the elements of list on the k^(th) diagonal.

DiagonalMatrix[list,k,n]
pads with s to create an n×n matrix.

DetailsDetails

Introduced in 1988
(1.0)
| Updated in 2008
(7.0)