Math · Linear Algebra

Matrices

A matrix is a structured collection of numbers. Edit one to see how its rows and columns combine vectors, data, and operations.

Concept

A vector is an ordered collection of components. A matrix is an ordered collection of entries arranged in rows and columns. It can record relationships, combine values, or act on a vector.

Equation

A=[a11a12;a21a22]

Manipulate

Choose a shape and edit A.

Addition

Matrices can be added only when they have the same dimensions. That makes every entry in one matrix correspond to exactly one entry in the other.

Scalar multiplication

Matrix × vector

This is the central operation: each row of A takes a dot product with the input vector and produces one output component. Select a row calculation to trace it.

Matrix × matrix

For A:m×n and B:n×p, the matching inner dimensions allow multiplication, and the outer dimensions give AB:m×p.

Observe

The identity matrix leaves a vector unchanged: Ix=x, and it satisfies AI=IA=A. The zero matrix sends every vector to zero: 0x=0. Try the Identity and Swap presets to see both ideas.

Explain

Matrix multiplication is not just a rule for filling cells. It describes composition: first use B to combine values, then use A to combine the result. Reversing that order can produce a different answer.

Computing, data & machine learning

Datasets use rows for observations and columns for features. Images are grids of pixel values. Graphics uses matrices to encode transformations. In machine learning, a layer is often summarized as y=Wx+b: x is an input vector, W is a weight matrix, b is a bias vector, and y is an output vector.

Matrix transformations

x→Ax

What happens to the whole coordinate plane when every vector is multiplied by A?