Function of Matrices