What Is a Matrix?

A matrix is a rectangular grid of numbers, written in square brackets:

A = \begin{bmatrix} 2 & -1 & 0 \\ 3 & 5 & 4 \end{bmatrix}.

Its size is given as rows × columns. The matrix above is 2 \times 3 — two rows, three columns. We name the entry in row i, column j as a_{ij}; here a_{12} = -1 and a_{23} = 4. Row first, then column — always.

A matrix is more than a table. Its real job, as the next lessons reveal, is to transform vectors — to take in a vector and spit out a new one. For now, let's get comfortable reading the grid.

Find the entry

Dial a row and a column. The highlighted cell is a_{ij}, and the readout names it. Get used to the convention — countless bugs come from swapping row and column.

Rows, columns, and shape

Two special shapes matter most. A matrix with one column is exactly a column vector — so vectors are just skinny matrices. A square matrix has as many rows as columns, and those are the ones that can act as transformations of a space onto itself. Shape decides what a matrix is allowed to do.