Calculate the cosine of each element of a Matrix.
This function calculates the cosine of each element in a Matrix