Implemented mat.PutMatrix