Matrix:

Transposed Matrix:

Steps to Transpose a Matrix:

  1. For a given matrix, flip its rows and columns.
  2. The element at position (i, j) in the original matrix moves to position (j, i) in the transposed matrix.
  3. The resulting matrix will have its rows and columns swapped.