Source codeVideos

Command Palette

Search for a command to run...

Matrix

Matrix Types

Row Matrix

A row matrix is a matrix that consists of only one row.

The order of a row matrix is 1×n1 \times n, where nn is the number of columns.

Its general form is:

A1×n=[a11a12a1n]A_{1 \times n} = \begin{bmatrix} a_{11} & a_{12} & \dots & a_{1n} \end{bmatrix}

Example:

P=[3107]P = \begin{bmatrix} 3 & -1 & 0 & 7 \end{bmatrix}

Matrix PP is a row matrix of order 1×41 \times 4.

Column Matrix

A column matrix is a matrix that consists of only one column.

The order of a column matrix is m×1m \times 1, where mm is the number of rows.

Its general form is:

Bm×1=[a11a21am1]B_{m \times 1} = \begin{bmatrix} a_{11} \\ a_{21} \\ \vdots \\ a_{m1} \end{bmatrix}

Example:

Q=[254]Q = \begin{bmatrix} 2 \\ 5 \\ -4 \end{bmatrix}

Matrix QQ is a column matrix of order 3×13 \times 1.

Square Matrix

A square matrix is a matrix that has the same number of rows and columns.

If the number of rows = number of columns = nn, then the matrix is of order n×nn \times n.

Its general form is:

An×n=[a11a12a1na21a22a2nan1an2ann]A_{n \times n} = \begin{bmatrix} a_{11} & a_{12} & \dots & a_{1n} \\ a_{21} & a_{22} & \dots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \dots & a_{nn} \end{bmatrix}

In a square matrix, there are:

  1. Main Diagonal (or Principal Diagonal):

    The elements a11,a22,,anna_{11}, a_{22}, \dots, a_{nn} (i.e., aija_{ij} where i=ji=j).

  2. Anti-diagonal (or Counter-diagonal):

    The elements a1n,a2,n1,,an1a_{1n}, a_{2,n-1}, \dots, a_{n1} (i.e., aija_{ij} where i+j=n+1i+j=n+1).

Example:

M=[123456789]M = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}

Matrix MM is a square matrix of order 3×33 \times 3. Its main diagonal elements are 1,5,91, 5, 9. Its anti-diagonal elements are 3,5,73, 5, 7.

Rectangular Matrix

A rectangular matrix is a matrix where the number of rows and columns are not equal (mnm \neq n).

General example:

C=[123456]C = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}

Matrix CC above has 2 rows and 3 columns, so its order is 2×32 \times 3. Since the number of rows is not equal to the number of columns (232 \neq 3), matrix CC is a rectangular matrix.

Rectangular matrices can be further distinguished into horizontal matrices and vertical matrices.

Horizontal Matrix

A horizontal matrix is a rectangular matrix with more columns than rows (n>mn > m).

Example:

D=[104235]D = \begin{bmatrix} 1 & 0 & 4 \\ -2 & 3 & 5 \end{bmatrix}

Matrix DD is a horizontal matrix of order 2×32 \times 3.

Vertical Matrix

A vertical matrix is a rectangular matrix with more rows than columns (m>nm > n).

Example:

T=[710342]T = \begin{bmatrix} 7 & 1 \\ 0 & -3 \\ 4 & 2 \end{bmatrix}

Matrix TT is a vertical matrix of order 3×23 \times 2.

Triangular Matrix

A triangular matrix is a square matrix where the elements below or above the main diagonal are zero.

Upper Triangular Matrix

An upper triangular matrix is a square matrix where all elements below the main diagonal are zero.

This means aij=0a_{ij} = 0 for every i>ji > j.

Example:

U=[521037001]U = \begin{bmatrix} 5 & 2 & -1 \\ 0 & 3 & 7 \\ 0 & 0 & 1 \end{bmatrix}

Lower Triangular Matrix

A lower triangular matrix is a square matrix where all elements above the main diagonal are zero.

This means aij=0a_{ij} = 0 for every i<ji < j.

Example:

L=[200460319]L = \begin{bmatrix} 2 & 0 & 0 \\ 4 & 6 & 0 \\ -3 & 1 & 9 \end{bmatrix}

Diagonal Matrix

A diagonal matrix is a square matrix where all elements outside the main diagonal are zero.

This means aij=0a_{ij} = 0 for every iji \neq j. Elements on the main diagonal can be zero or non-zero.

Example:

X=[700020000]X = \begin{bmatrix} 7 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & 0 \end{bmatrix}

Matrix XX is a diagonal matrix of order 3×33 \times 3.

Identity Matrix

An identity matrix (denoted by II or InI_n) is a diagonal matrix where all elements on the main diagonal are 1.

Example:

I2=[1001]I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}
I3=[100010001]I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}

The identity matrix acts as the neutral element in matrix multiplication.

Zero Matrix

A zero matrix (denoted by OO or Om×nO_{m \times n}) is a matrix where all elements are zero.

Example:

O2×2=[0000]O_{2 \times 2} = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}
O2×3=[000000]O_{2 \times 3} = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}

Symmetric Matrix

A symmetric matrix is a square matrix that is equal to its transpose (AT=AA^T = A).

This means the element aij=ajia_{ij} = a_{ji} for all ii and jj. Its elements are symmetric with respect to the main diagonal.

Example:

S=[173720305]S = \begin{bmatrix} 1 & 7 & -3 \\ 7 & 2 & 0 \\ -3 & 0 & 5 \end{bmatrix}

In matrix SS:

  • s12=s21=7s_{12} = s_{21} = 7
  • s13=s31=3s_{13} = s_{31} = -3
  • s23=s32=0s_{23} = s_{32} = 0