[back] [prev] [next] [index] [root]

 


MatDiag

missing shortdoc

Syntax:

M := MatDiag(S, L);

matrix
  M  
ring
  S  
list
  L  
diagonal entries

Description:

Creates the diagonal matrix M over the coefficient ring S. L is a list containing the diagonal entries.


Example:

Create the diagonal matrix \left(\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 0 & 2 & 0 & 0 & 0 0 & 0 & 3 & 0 & 0 0 & 0 & 0 & 4 & 0 0 & 0 & 0 & 0 & 5 \end{array}right) \in {Z}^{5 \times 5}.

kash> MatDiag(Z, [1, 2, 3, 4, 5]);
> [1 0 0 0 0]
[0 2 0 0 0]
[0 0 3 0 0]
[0 0 0 4 0]
[0 0 0 0 5]


<- back[back] [prev] [next] [index] [root]