Skip to contents

Extracts all diagonals from a matrix in the NWSE direction (upper left down to lower right).

Usage

extract_2D_diags(mx)

Arguments

mx

matrix

Value

A list whose elements each represent one diagonal of mx. Each diagonal element is a list of two elements: coords is a numeric vector pair of row-column coordinates; values is the value of the diagonal at the coordinate give by coords.