find the transpose of a matrix