Calculates the absolute value of a matrix.