band_matrix INDEX

BAND_MATRIX _ _ _ _ _ _ _ _ _ _ _ _ operator

syntax:

band_matrix(<expr\_list>,<square\_size>)

<expr\_list> :- either a single scalar expression or a list of an odd number of scalar expressions.

<square\_size> :- a positive integer.

band_matrixcreates a square matrix of dimension <square\_size>. The diagonal consists of the middle expression of the <expr\_list>. The expressions to the left of this fill the required number of sub_diagonals and the expressions to the right the super_diagonals.

examples:



band_matrix({x,y,z},6) 

  [y  z  0  0  0  0]
  [                ]
  [x  y  z  0  0  0]
  [                ]
  [0  x  y  z  0  0]
  [                ]
  [0  0  x  y  z  0]
  [                ]
  [0  0  0  x  y  z]
  [                ]
  [0  0  0  0  x  y]

Related functions: diagonal.