New function:
-Checks whether the matrix is changed or not.