rev_matrix function

Rervese the elements in a matrix