matrix2longdf function

Transform a matrix into a long-format data.frame