BL2.ru

Matrix transposition online

Transpose a matrix: rows become columns. The result and each step Bᵢₖ = Aₖᵢ appear instantly.

A
3
3
T
=
B
3
3
Direct link to the calculation
B1,1 = A1,1 = 0
B1,2 = A2,1 = 0
B1,3 = A3,1 = 0
B2,1 = A1,2 = 0
B2,2 = A2,2 = 0
B2,3 = A3,2 = 0
B3,1 = A1,3 = 0
B3,2 = A2,3 = 0
B3,3 = A3,3 = 0

What it is

Matrix transposition turns the rows of a matrix into columns and the columns into rows; the matrix is "mirrored" across its main diagonal. Formally, the transposed matrix of a matrix A of size m×n is the matrix AT of size n×m defined as AT[i, j] = A[j, i].

Example

A 2×3 matrix becomes 3×2: the first row (1, 2, 3) becomes the first column, the second (4, 5, 6) the second.

A
123
456
AT
14
25
36

The main diagonal elements (a11 = 1, a22 = 5) stay in place.

Properties

  • (AT)T = A — transposing twice returns the original.
  • (A + B)T = AT + BT, (k·A)T = k·AT.
  • (A·B)T = BT·AT — the order of factors reverses.
  • det AT = det A for a square matrix.
  • If AT = A the matrix is symmetric (covariance and distance matrices); if AT = A−1 it is orthogonal (rotation matrices).
  • Transposition turns a row vector into a column vector and back.

Where it is used

  • Least squares and regression — the coefficients come from the normal equations XT·X·β = XT·y. For points x = 1, 2, 3 the matrix X = {{1, 1}, {1, 2}, {1, 3}} gives XT·X = {{3, 6}, {6, 14}}.
  • Statistics — covariance and correlation matrices (XT·X for centred data), the dot product of vectors as xT·y.
  • Machine learning — backpropagation in neural networks uses transposed weight matrices.
  • 3D graphics — the inverse of a rotation matrix is its transpose; normals are transformed by (M−1)T.
  • Tables and data — swap the rows and columns of a report (like "Transpose" in Excel), reshape an array in code.
  • Graphs — the transposed adjacency matrix of a directed graph is the graph with all edges reversed.
  • Studying — check solutions involving BT·AT, symmetric and orthogonal matrices.

How to use

  • Set the size of A with the add/remove row and column buttons and fill in the cells.
  • Or enter the matrix as a string {rows,cols,elements…}, e.g. {2,3,1,2,3,4,5,6}.
  • The transposed matrix B = AT, the entry Bi,j = Aj,i for every element and the link to the calculation update instantly.

FAQ

What is a transposed matrix?
Aᵀ with (Aᵀ)ᵢₖ = Aₖᵢ; a 2×3 matrix becomes 3×2.
Properties of transposition?
(Aᵀ)ᵀ = A, (A + B)ᵀ = Aᵀ + Bᵀ, (A·B)ᵀ = Bᵀ·Aᵀ, det Aᵀ = det A.
What is a symmetric matrix?
A square matrix equal to its transpose: A = Aᵀ.
Where is it used?
Least squares (normal equations AᵀA·x = Aᵀb), 3D graphics (inverse rotation equals transpose), statistics.