DiagonalMatrix - Maple Help

Student[LinearAlgebra]

 DiagonalMatrix
 construct a (block) diagonal Matrix

 Calling Sequence DiagonalMatrix(V, options)

Parameters

 V - Vector or list; diagonal entries options - (optional) parameters; for a complete list, see LinearAlgebra[DiagonalMatrix]

Description

 • The DiagonalMatrix(V) command constructs a (block) diagonal Matrix whose diagonal entries, starting from the upper-left corner, are the elements of V.
 • If V is a Vector or a list of scalar values, then the blocks are $1x1$ and DiagonalMatrix(V) constructs a diagonal Matrix.
 • If V is a list $\left[\mathrm{B1},\mathrm{B2},\dots ,\mathrm{Bn}\right]$ containing any non-scalar value, then the blocks are not necessarily $1x1$ and DiagonalMatrix(V) builds a Matrix by placing each element, Bj, of V as an expanded block of entries, with each block placed immediately below and to the right of its predecessor. If the elements of V are all square (scalar values or square Matrices), a diagonal or block diagonal Matrix in the usual sense is returned.
 • By using this command in conjunction with the JordanBlockMatrix command, you can create a Jordan Matrix.

Examples

 > $\mathrm{with}\left({\mathrm{Student}}_{\mathrm{LinearAlgebra}}\right):$
 > $L≔\left[⟨⟨1,2⟩|⟨x,y⟩⟩,3,⟨⟨4,5⟩|⟨6,7⟩⟩\right]$
 ${L}{≔}\left[\left[\begin{array}{cc}{1}& {x}\\ {2}& {y}\end{array}\right]{,}{3}{,}\left[\begin{array}{cc}{4}& {6}\\ {5}& {7}\end{array}\right]\right]$ (1)
 > $\mathrm{DiagonalMatrix}\left(L\right)$
 $\left[\begin{array}{ccccc}{1}& {x}& {0}& {0}& {0}\\ {2}& {y}& {0}& {0}& {0}\\ {0}& {0}& {3}& {0}& {0}\\ {0}& {0}& {0}& {4}& {6}\\ {0}& {0}& {0}& {5}& {7}\end{array}\right]$ (2)
 > $V≔⟨1,2,3,4⟩$
 ${V}{≔}\left[\begin{array}{c}{1}\\ {2}\\ {3}\\ {4}\end{array}\right]$ (3)
 > $\mathrm{DiagonalMatrix}\left(V\right)$
 $\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {2}& {0}& {0}\\ {0}& {0}& {3}& {0}\\ {0}& {0}& {0}& {4}\end{array}\right]$ (4)