A submatrix of a matrix is another matrix obtained by forming the intersection of certain rows and columns, or equivalently by deleting certain rows and columns. More precisely, let be an
matrix and let
and
. Then the
matrix
with
is the submatrix of
comprising the elements at the intersection of the rows indexed by
and the columns indexed by
. For example, for the matrix
shown with four elements highlighted in two different ways,
is a submatrix (the intersection of rows and
and columns
and
, or what is left after deleting row
and column
), but
is \emph{not} a submatrix.
Submatrices include the matrix elements and the matrix itself, but there are many of intermediate size: an
matrix has
submatrices in total (counting both square and nonsquare submatrices).
If and
,
, then
is a principal submatrix of
, which is a submatrix symmetrically located about the diagonal. If, in addition,
,
, then
is a leading principal submatrix of
, which is one situated in the top left corner of
.
The determinant of a square submatrix is called a minor. The Laplace expansion of the determinant expresses the determinant as a weighted sum of minors.
The Colon Notation
In various programming languages, notably MATLAB, and in numerical linear algebra, a colon notation is used to denote submatrices consisting of contiguous rows and columns.
For integers and
we denote by
the sequence
. Thus
is another way of writing
.
We write for the submatrix of
comprising the intersection of rows
to
and columns
to
, that is,
We can think of as a projection of
using the corresponding rows and columns of the identity matrix:
As special cases, denotes the
th row of
and
the
th column of
.
Here are some examples of using the colon notation to extract submatrices in MATLAB. Rows and columns can be indexed by a range using the colon notation or by specifying the required indices in a vector. The matrix used is from the Anymatrix collection.
>> A = anymatrix('core/beta',5)
A =
1 2 3 4 5
2 6 12 20 30
3 12 30 60 105
4 20 60 140 280
5 30 105 280 630
>> A(3:4, [2 4 5]) % Rectangular submatrix.
ans =
12 60 105
20 140 280
>> A(1:2,4:5) % Square, but nonprincipal, submatrix.
ans =
4 5
20 30
>> A([3 5],[3 5]) % Principal submatrix.
ans =
30 105
105 630
Block Matrices
Submatrices are intimately associated with block matrices, which are matrices in which the elements are themselves matrices. For example, a matrix
can be regarded as a block
matrix, where each element is a
submatrix of
:
where
and likewise for the other three blocks.
Related Blog Posts
This article is part of the “What Is” series, available from https://nhigham.com/index-of-what-is-articles/ and in PDF form from the GitHub repository https://github.com/higham/what-is.
