This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Construction /

DiagonalMatrix

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

FilledSmallSquare See Section 1.8.3 and Section 3.7.1.

FilledSmallSquare See also: IdentityMatrix, Tr, KroneckerDelta.

FilledSmallSquare Related package: LinearAlgebra`MatrixManipulation`.

FilledSmallSquare New in Version 1.

Further Examples