Friday, October 10, 2025
HomeMatlabWhat Is a Submatrix?

What Is a Submatrix?


A submatrix of a matrix is one other matrix obtained by forming the intersection of sure rows and columns, or equivalently by deleting sure rows and columns. Extra exactly, let A be an m\times n matrix and let 1\le i_1 < i_2 < \cdots < i_p \le m and 1\le j_1 < j_2 < \cdots < j_q \le n. Then the p\times q matrix B with b_{rs} = a_{i_rj_s} is the submatrix of A comprising the weather on the intersection of the rows listed by i_1,\dots,i_p and the columns listed by j_1,\dots,j_q. For instance, for the matrix

\notag     \begin{bmatrix} ~\fbox{1} & \fbox{2} & 3\mskip2mu \\                        ~~4 & 5 & 6\mskip2mu~ \\                        ~\fbox{7} & \fbox{8} & 9~\mskip2mu        \end{bmatrix} =     \begin{bmatrix} ~\fbox{1} & \fbox{2} & 3\mskip2mu~ \\[1pt]                        ~\fbox{4} & 5 & 6\mskip2mu~ \\                        7 & \fbox{8} & 9\mskip2mu        \end{bmatrix},

proven with 4 parts highlighted in two alternative ways,

\notag        \begin{bmatrix} 1 & 2 \\                        7 & 8 \\        \end{bmatrix}

is a submatrix (the intersection of rows 1 and 3 and columns 1 and 2, or what’s left after deleting row 2 and column 3), however

\notag        \begin{bmatrix} 1 & 2 \\                        4 & 8 \\        \end{bmatrix}

is emph{not} a submatrix.

Submatrices embrace the mn matrix parts and the matrix itself, however there are various of intermediate measurement: an m\times n matrix has (2^m-1)(2^n-1) submatrices in whole (counting each sq. and nonsquare submatrices).

If p = q and i_k = j_k, k = 1\colon p, then B is a principal submatrix of A, which is a submatrix symmetrically situated concerning the diagonal. If, as well as, i_k = k, k=1\colon p, then B is a main principal submatrix of A, which is one located within the prime left nook of A.

The determinant of a sq. submatrix is known as a minor. The Laplace enlargement of the determinant expresses the determinant as a weighted sum of minors.

The Colon Notation

In varied programming languages, notably MATLAB, and in numerical linear algebra, a colon notation is used to indicate submatrices consisting of contiguous rows and columns.

For integers p and q we denote by p\colon q the sequence p,p+1,\dots,q. Thus i = 1\colon n is one other approach of writing i = 1,2,\dots,n.

We write A(p\colon q,r \colon s) for the submatrix of A comprising the intersection of rows p to q and columns r to s, that’s,

A(p\colon q,r \colon s) = \begin{bmatrix}a_{pr} & \cdots & a_{ps} \\                             \vdots                & \ddots & \vdots\cr a_{qr} & \cdots & a_{qs}                              \end{bmatrix}.

We will consider A(p\colon q,r \colon s) as a projection of A utilizing the corresponding rows and columns of the id matrix:

\notag    A(p\colon q,r \colon s) = I(p\colon q,:) \,A \,I(:,r\colon s).

As particular circumstances, A(k,\colon) denotes the kth row of A and A(\colon,k) the kth column of A.

Listed below are some examples of utilizing the colon notation to extract submatrices in MATLAB. Rows and columns could be listed by a spread utilizing the colon notation or by specifying the required indices in a vector. The matrix used is from the Anymatrix assortment.

>> 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)      % Sq., however nonprincipal, submatrix.
ans =
     4     5
    20    30

>> A([3 5],[3 5])  % Principal submatrix.
ans =
    30   105
   105   630

Block Matrices

Submatrices are intimately related to block matrices, that are matrices wherein the weather are themselves matrices. For instance, a 4\times 4 matrix A could be thought to be a block 2\times 2 matrix, the place every aspect is a 2\times 2 submatrix of A:

\notag   A = \left[\begin{array}cc         a_{11} & a_{12} & a_{13} & a_{14}\\         a_{21} & a_{22} & a_{23} & a_{24}\\\hline         a_{31} & a_{32} & a_{33} & a_{34}\\         a_{41} & a_{42} & a_{43} & a_{44}\\         \end{array}\right]    =  \begin{bmatrix}         A_{11} & A_{12} \\         A_{21} & A_{22}        \end{bmatrix},

the place

\notag  A_{11} =   A(1\colon2,1\colon2) = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix},

and likewise for the opposite three blocks.

Associated Weblog Posts

This text is a part of the “What Is” collection, out there from https://nhigham.com/index-of-what-is-articles/ and in PDF kind from the GitHub repository https://github.com/higham/what-is.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments