Function of a Matrix