Atom - ŒD - Matrix Diagonals

Characters: Π, D

Tags: miscellaneous , matrix , vectorize

Arity: monadic

This atom is monadic, which means it takes one argument.


Return the diagonals of z, starting with the main diagonal.


Following the main diagonal, each diagonal is outputted going to the right. Diagonals will not wrap around, so [1,2],[3,4] ŒD returns [[1, 4], [2], [3]] and not [[1, 4], [2, 3]].