This online Matrix Calculator is designed to perform basic operations with a matrix. It calculates the matrix rank and determinant, finds its inverse and transpose forms, computes the adjugate matrix, performs multiplication of the matrix by a constant and LU decomposition of the matrix. You can paste the matrix copied from a spreadsheet or csv-file or enter manually using comma or space as separators between matrix elements. Each row of a matrix must end with a newline character (\n or enter). All the rows of a matrix must be of the same length, otherwise the matrix is considered incomplete. Before performing calculations, please click ‘Check A’ button to check the matrix for completeness and align its columns.
Matrix in Mathematics
A matrix is a mathematical object which is a rectangular array (or table) of numbers, symbols, or expressions arranged in rows and columns. A matrix with \(m\) rows and \(n\) columns is called an \(m\)-by-\(n\) matrix (or \(m\)×\(n\) matrix) and \(m\) and \(n\) are called its dimensions. The elements of matrix \(A\) are denoted as follows: \(a_{i,j}\), where \(1 ≤ i ≤ m\) and \(1 ≤ j ≤ n\).
For example, the matrix
$$A = \begin{bmatrix} 4 \ 2 \ 3 \ 9 \\ 0 \ 6 \ 9 \ 8 \\ 9 \ 1 \ 5 \ 7 \\ \end{bmatrix}$$
is a 3×4 matrix. The element \(A[2,4]\) or \(a_{2,4}\) is 8.
Matrices are widely used and play a very important role in various scientific and applied fields, including linear algebra, physics, computer science, and data analysis.
Single Matrix Operations
The various mathematical operations performed on matrices form a central part of linear algebra and matrix theory. All those operations can be divided into two groups.
The first group includes operations involving two generally different matrices. These operations include: matrix addition, matrix subtraction, matrix multiplication.
The second group includes operations performed on a single matrix. These operations include: calculating the rank and determinant of a matrix, multiplying a matrix by a scalar, transposing a matrix, calculating the adjugate matrix, calculating the inverse of a matrix, and calculating the LU decomposition a matrix.
This online matrix calculator performs basic operations on a single matrix. It includes the following calculators:
Matrix Rank Calculator
The rank of a matrix \(A\) is the number of linearly independent rows or columns of the matrix. Two rows \(i\) and \(k\) are said to be linearly independent if the equality \(c_1 a_{i,j} + c_2a_{k,j} = 0\) holds for any \(j\) only if both \(c_1\) and \(c_2\) equal to 0. The linear independence of the two columns is defined in the same way. A fundamental result in linear algebra is that the column rank and the row rank are always equal.
For example, in the matrix
$$A = \begin{bmatrix} 2 \ 3 \ 4 \\ 4 \ 6 \ 8 \\ \end{bmatrix}$$
the second row is just 2 times the first row. So the rank of \(A\) is only 1.
It is clear from the above definition that the maximum rank of a matrix is equal to the minimum value of its dimensions (i.e., the number of rows or columns). The matrix rank will be equal to zero only if it has no elements. If a matrix has at least one element, its minimal rank is equal to one.
A common approach to finding the rank of a matrix is to reduce it to a simpler form, usually row echelon form, using elementary operations on the rows and counting the number of non-zero rows.
The matrix rank finds applications in various areas, including system of linear equations, image processing and data compression. In solving systems of equations, the rank helps determine whether a solution exists and provides information about the number of solutions.
Matrix Determinant Calculator
The determinant of a matrix \(A\) is a scalar value that can be computed from the elements of a square matrix and encodes certain properties of the linear transformation described by the matrix. In particular, determinants can be used to characterize linearly dependent vectors and in solution of a system of linear equations.
A general determinant of an \(n\)×\(n\) matrix \(A\), commonly denoted \(det(A)\) or \(|A|\), for any value \(i=1, …, n\) can be presented in the form:
$$det(A) = \sum_{j=1}^n (-1)^{i+j} M_{i,j} a_{i,j} ,$$
where \(M_{i,j}\) is the minor of matrix \(A\) formed by eliminating row \(i\) and column \(j\) from \(A\). This procedure is iteratively applied to calculate the minors in terms of subminors, etc.
This online matrix determinant calculator uses the Bareiss Algorithm to calculate the determinant of a matrix.
The matrix determinant has the following main properties:
• If \(c\) is a constant and \(A\) is an \(n\)×\(n\) square matrix, then \(det(cA) = c^{n} det(A)\)
• And as a consequence \(det(-A) = (-1)^{n} det(A)\)
• Determinants have a distributive property: \(det(AB) = det(A)det(B)\)
• This means that \(det(I) = det(A A^{-1}) = det(A)det(A^{-1}) = 1\), where \(I\) is the identity matrix.
• The determinant of a transpose equals the determinant of the original matrix: \(det(A^{T}) = det(A)\)
The determinant is used in linear algebra to determine whether a matrix is invertible or singular. If the determinant is non-zero, the matrix is invertible, and an inverse matrix can be computed. On the other hand, if the determinant is zero, the matrix is singular, and its inverse does not exist. Determinants are also used to calculate eigenvalues and eigenvectors of a matrix.
Determinants are also employed in solving systems of linear equations. The Cramer’s rule, which expresses the solutions of a linear system in terms of determinants, utilizes the determinant of the coefficient matrix. By evaluating determinants, one can find out whether a system of equations has a unique solution, multiple solutions, or no solution at all.
The determinant also finds wide application in areas such as geometry, physics and engineering, computer science and graphics, optimization and data analysis.
Matrix Scalar Multiplication Calculator
The result of multiplication of a matrix \(A\) by a scalar (number) is a matrix with elements that are the product of the matrix \(A\) elements by that scalar:
$$(cA)_{i,j} = ca_{i,j} ,$$
where \(1 ≤ i ≤ m\) and \(1 ≤ j ≤ n\).
And as a consequence of the above simple definition, the following properties of scalar matrix multiplication follow: the associative property of multiplication; the distributive property of multiplication both with respect to the sum of matrices and with respect to the sum of scalar factors.
As we see the scalar multiplication involves multiplying each element of a matrix by a constant scalar value. This operation scales the matrix uniformly without altering its structure. Scalar multiplication is a fundamental operation in linear transformations and matrix algebra.
For example, scalar multiplication is employed in image processing to enhance or diminish pixel intensity. By multiplying each pixel value by a scalar factor, the overall brightness or contrast of the image can be adjusted.
Matrix Transpose Calculator
The transpose of a matrix is an operation which switches the row and column indices (exchanges rows and columns) of a matrix \(A\) by producing another matrix denoted as \({ A }^{ T }\). So we have:
$$a^T_{i,j} = a_{j,i} \ .$$
The matrix transpose has the following main properties:
• \((A^T)^T = A\)
• \((A + B)^T = A^T + B^T\)
• \((AB)^T = B^T A^T\)
• \((cA)^T = cA^T\)
• \(det(A^T) = det(A)\)
The transpose operation is widely used in various mathematical applications. In particular it enables the representation of row vectors as column vectors and vice versa.
Transposing a matrix is often used in various matrix operations. The transpose operation is also useful in solving systems of linear equations.
Transposing plays a role in identifying symmetry and skew-symmetry properties of matrices. These properties have applications in areas such as physics, where symmetry and skew-symmetry are important concepts.
Transposing a matrix can be useful for data representation purposes. It is also employed in certain eigenvalue and eigenvector computations. The transpose operation helps simplify calculations and establish important relationships between eigenvalues and eigenvectors.
Adjugate Matrix Calculator
Adjugate (or adjoint, or adjunct) of a square matrix \(A\) is the transpose of its cofactor matrix. The cofactor matrix of \(A\) is the \(n × n\) matrix \(C\) whose \((i, j)\) entry is the \((i, j)\) cofactor of \(A\), which is the \((i, j)\)-minor times a sign factor: \({C} = \left((-1)^{i+j} {M}_{ij}\right)\), where \(1 ≤ i ≤ n\) and \(1 ≤ j ≤ n\):
$$adj(A) = C^T.$$
The adjugate matrix has the following main properties:
• \(adj(O) = O\) and \(adj(I) = I\), where \(O\) is a null matrix and \(I\) is an identity matrix.
• \(adj(A^T) = adj(A)^T\)
• \(A \ adj(A) = adj(A) \ A = det(A) \ I\), where \(I\) is an identity matrix.
• \(adj(AB) = adj(B) adj(A)\)
• \(adj(A^k) = adj(A)^k\) for any non-negative integer \(k\).
• The adjoint of a diagonal matrix is also a diagonal matrix.
One of the most important consequences of these properties is the following fundamental result of matrix algebra:
$$A^{-1} = \frac {1}{det(A)} \ adj(A).$$
The inverse of a matrix \(A\), which is represented as \(A^{-1}\), is extremely important for solving many problems, such as solving a system of linear equations.
Inverse Matrix Calculator
The inverse of a square matrix \(A\) is a square matrix \({ A }^{ -1 }\) such that \(AA^{-1} = A^{-1}A = I\), where \(I\) is the identity (or unit) matrix. A square matrix that is not invertible is called singular or degenerate. A square matrix is singular if and only if its determinant is zero.
Our online inverse matrix calculator uses the above formula expressing an inverse matrix in terms of its adjugate matrix and its determinant.
The following main properties hold for an invertible matrix \(A\):
• \((A^{-1})^{-1} = A\)
• \((kA)^{-1} = k^{-1} A^{-1}\) for nonzero scalar \(k\).
• \((A^T)^{-1} = (A^{-1})^T\)
• \(det(A^{-1}) = (detA)^{-1}\)
The inverse matrix serves several important purposes. One of the primary and obvious uses of the inverse matrix is in solving systems of linear equations. It also allows for the solution of matrix equations.
In certain situations, the inverse matrix is used to reverse or undo a matrix transformation. For example, in computer graphics, the inverse matrix can be employed to transform a point back to its original position after applying a sequence of transformations.
In linear algebra, the inverse matrix plays a crucial role in changing the basis of a vector space. This is particularly important in fields like quantum mechanics and signal processing, where changing bases is necessary for analysis and computations.
The inverse matrix is used in various numerical methods, such as solving differential equations, optimization problems, and data fitting. In some cases, matrix decomposition methods, such as LU decomposition or Cholesky decomposition, involve computing the inverse of certain matrices as intermediate steps.
LU Decomposition Calculator
Matrix LU Decomposition, also known as lower–upper decomposition or LU factorization, is a method to decompose a square matrix into the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\). So a square matrix \(A\) can be represented as \(A = LU\).
The decomposition can be computed using various algorithms. One of the most common is the Gaussian elimination with partial pivoting method which we use in our LU decomposition calculator. This method involves row operations and partial pivoting (rearranging the rows) to transform the original matrix into the desired triangular form. The partial pivoting is necessary to make the algorithm numerically stable.
So, the general formula of the LU decomposition taking into account the pivoting is:
$$PA = LU,$$
where \(P\) is a permutation matrix, \(L\) is a lower triangular matrix with ones on the diagonal and \(U\) is an upper triangular matrix.
The LU decomposition is a powerful tool in numerical analysis and scientific computing. It provides a means to simplify and accelerate computations involving matrices, especially when solving systems of linear equations, calculating matrix inverses, and performing determinant calculations. The decomposition enhances the efficiency and stability of numerical algorithms and is widely used in various fields, including engineering, physics, computer science, and data analysis.
Related calculators
Check out our other algebra calculators such as Matrix Operations Calculator or 2×2 System of Linear Equations Calculator.