Traversing the elements of amatrix using diagonals

Traversing the elements of  a matrix/array using diagonals.

The traversing implemented in the code is an left-to-right and up-to-down
diagonal starting in the point (maximum row, minimum column) and finishing in
the point (minimum row, maximum column).

The input matrix might be a square of a rectangle. (the number of rows does
not have to be the same as the number of columns)