What is a matrix?

Martin McBride
Graphic maths
Published in
10 min readOct 26, 2023

--

A matrix is a 2-dimensional array of numbers, for example:

This article gives a basic introduction to matrices, including their properties, some of the operations that can be carried out on matrices, some special types of matrices, and finally some examples of how matrices are used, particularly in mathematics and computer science.

Shape of a matrix

The most obvious property of a matrix is its shape. The shape of a matrix is defined by the number of rows and the number of columns. For example, the matrix above is a 2 by 3 matrix, because it has 2 rows and 3 columns.

The shape of a matrix is sometimes called its size. The two terms are interchangeable

Note that the row, column order used in matrices is different to the x, y order we often use in maths.

The individual elements are also numbered in row, column order, as shown here:

Element a(2, 0), for example, is the element in row 2, column 0.

Special matrix shapes

Some particular matrix shapes are very useful.

A square matrix has the same number of rows and columns. For example a 2 by 2 matrix, a 3 by 3 matrix, and so on. Here is an example 3 by 3 matrix:

--

--