Algosim documentation: ReversalMatrix

ReversalMatrix

Returns a reversal matrix.

Syntax

Description

If n is a positive integer, then ReversalMatrix(n) returns the n-dimensional reversal matrix, that is, the n×n matrix with 1s on the antidiagonal and 0s everywhere else.

Examples

ReversalMatrix(4)
⎛0  0  0  1⎞
⎜0  0  1  0⎟
⎜0  1  0  0⎟
⎝1  0  0  0⎠

See also