diagonal INDEX

DIAGONAL _ _ _ _ _ _ _ _ _ _ _ _ operator

syntax:

diagonal({<mat\_list>})

(If you are feeling lazy then the braces can be omitted.)

<mat\_list> :- each can be either a scalar expression or a square matrix.

diagonalcreates a matrix that contains the input on the diagonal.

examples:



H := mat((66,77),(88,99)); 

       [66  77]
  h := [      ]
       [88  99]



diagonal({A,x,H}); 

  [1  2  3  0  0   0 ]
  [                  ]
  [4  5  6  0  0   0 ]
  [                  ]
  [7  8  9  0  0   0 ]
  [                  ]
  [0  0  0  x  0   0 ]
  [                  ]
  [0  0  0  0  66  77]
  [                  ]
  [0  0  0  0  88  99]

Related functions: jordan_block.