Skip to content
Glacius
Linear algebraConcept reference

Matrix transpose

The transpose exchanges every entry’s row and column positions, turning an m-by-n matrix into an n-by-m matrix.

On this page 7 sections
  1. Overview
  2. Transposing moves each row into a column
  3. The superscript T names the transpose
  4. A table can store items as rows and measurements as columns
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01Transposing moves each row into a column#

Transposing moves each row into a column. The values stay the same, and their order within that row is preserved.

A has rows (1,2,3) and (4,5,6). Its transpose has rows (1,4), (2,5), (3,6). The first original row becomes the first new column; the second original row becomes the second new column. Shape changes from 2×3 to 3×2.A has rows (1,2,3) and (4,5,6). Its transpose has rows (1,4), (2,5), (3,6). The first original row becomes the first new column; the second original row becomes the second new column. Shape changes from 2×3 to 3×2.
Figure 1A has rows (1,2,3) and (4,5,6). Its transpose has rows (1,4), (2,5), (3,6). The first original row becomes the first new column; the second original row becomes the second new column. Shape changes from 2×3 to 3×2.
Link to this figure ↗Download SVGDownload PNG

For A=[123456]A=\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}, the first row (1,2,3)(1,2,3) becomes the first column. The second row (4,5,6)(4,5,6) becomes the second column.

AT=[142536]A^T=\begin{bmatrix}1&4\\2&5\\3&6\end{bmatrix}
Check your reasoning

Transpose the single row (2,5)(2,5). Choose the new rows.

  1. ARows: (2,5)
  2. BRows: (5); (2)
  3. CRows: (2); (5)
Show answer and explanation
Rows: (2); (5)

Keep the order: 2 above 5.

02The superscript T names the transpose#

The superscript T names the transpose. Entry AijA_{ij} starts in row i, column j. In the transpose it occupies row j, column i, so a value at (1,3) moves to (3,1).

Check your reasoning

A has 2 rows and 3 columns. What shape should replace a claimed 2×32\times3 transpose?

  1. A3 rows, 2 columns
  2. B2 rows, 3 columns
  3. C3 rows, 3 columns
Show answer and explanation
3 rows, 2 columns

The three original columns become three rows.

03A table can store items as rows and measurements as columns#

A table can store items as rows and measurements as columns. Transposing makes each measurement a row, with the item values still in their original order. No averaging or arithmetic is needed.

Check your reasoning

Columns: hits, misses. Rows: U (3,1); V (2,0). Choose the transposed rows, hits first.

  1. ARows: (3,1); (2,0)
  2. BRows: (3,2); (1,0)
  3. CRows: (2,3); (0,1)
Show answer and explanation
Rows: (3,2); (1,0)

Keep U, V order: hits (3,2); misses (1,0).

Key takeaway

Move entry (i,j) to (j,i). Each original row becomes a column in the same order.

  • Transpose a rectangular matrix.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Matrix transpose.” Math behind ML. /learn/la-transpose