# Swapping rows and columns in matrix [closed]

If I have an array like the following

$\left( \begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{array} \right)$

How can I swap the rows and columns, so it is transformed into this?

$\left( \begin{array}{ccc} 1 & 4 & 7 \\ 2 & 5 & 8 \\ 3 & 6 & 9 \end{array} \right)$

This question touches upon the subject, but rather than swapping it simply rotates the matrix.

-

## closed as off-topic by Kuba, halirutan, bobthechemist, belisarius, JensMay 27 '14 at 17:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Kuba, halirutan, bobthechemist, belisarius, Jens
If this question can be reworded to fit the rules in the help center, please edit the question.

Take a look at Transpose. –  Kuba May 27 '14 at 16:42
And for more general matrix operations see here –  bobthechemist May 27 '14 at 17:00
You need to be familiar with the mathematical term to know what to search for: en.wikipedia.org/wiki/Matrix_transpose –  Szabolcs May 27 '14 at 17:47

m = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};