( m n k z -- matrix ) (original) (raw)
Inputs
Outputs
Word description
Creates an m x n matrix with a diagonal of z offset by k from the main diagonal. A positive value of k gives a diagonal above the main diagonal, whereas a negative value of k gives a diagonal below the main diagonal.
Examples
USING: math.matrices prettyprint ; 5 6 0 4 .
{ { 4 0 0 0 0 0 } { 0 4 0 0 0 0 } { 0 0 4 0 0 0 } { 0 0 0 4 0 0 } { 0 0 0 0 4 0 } }
USING: math.matrices prettyprint ; 5 5 2 2 .
{ { 0 0 2 0 0 } { 0 0 0 2 0 } { 0 0 0 0 2 } { 0 0 0 0 0 } { 0 0 0 0 0 } }
Definition