Matrix Calculator
Add, subtract and multiply compatible matrices.
Free online tool by SOCE. Check inputs and results before using them for important decisions.
Matrix Calculator – Perform Matrix Operations Online
Perform matrix calculations conveniently with the free Matrix Calculator from SOCE. Whether you are studying linear algebra, solving systems of equations, working on engineering problems, or performing mathematical computations, this tool helps you work with matrices.
A matrix is a rectangular arrangement of numbers, symbols or mathematical expressions organised into rows and columns. Matrices are widely used in mathematics, physics, computer science, structural engineering, numerical analysis and data science.
For example, a matrix with two rows and two columns is written as:
[
A=\begin{bmatrix}
1&2\
3&4
\end{bmatrix}
]
This is called a (2\times2) matrix.
Use the calculator above for the matrix operations it supports, and explore the mathematical concepts, formulas and worked examples explained below.
What Is a Matrix?
A matrix is an arrangement of elements in rows and columns, usually represented by a capital letter such as (A), (B) or (C).
The general form of a matrix is:
[
A=
\begin{bmatrix}
a_{11}&a_{12}&\cdots&a_{1n}\
a_{21}&a_{22}&\cdots&a_{2n}\
\vdots&\vdots&\ddots&\vdots\
a_{m1}&a_{m2}&\cdots&a_{mn}
\end{bmatrix}
]
Where:
- A = Matrix.
- m = Number of rows.
- n = Number of columns.
- aᵢⱼ = Element located in the ith row and jth column.
- m × n = Order or dimension of the matrix.
For example:
[
A=\begin{bmatrix}
2&4&6\
1&3&5
\end{bmatrix}
]
This matrix has 2 rows and 3 columns, so its order is (2\times3).
Types of Matrices
Matrices can be classified according to their dimensions and properties.
1. Row Matrix
A row matrix contains only one row.
[
A=\begin{bmatrix}2&4&6\end{bmatrix}
]
2. Column Matrix
A column matrix contains only one column.
[
B=\begin{bmatrix}
2\
4\
6
\end{bmatrix}
]
3. Square Matrix
A square matrix has an equal number of rows and columns.
[
A=\begin{bmatrix}
1&2\
3&4
\end{bmatrix}
]
Its order is (2\times2).
4. Rectangular Matrix
A rectangular matrix has a different number of rows and columns.
[
A=\begin{bmatrix}
1&2&3\
4&5&6
\end{bmatrix}
]
Its order is (2\times3).
5. Zero Matrix
A zero matrix contains only zero elements.
[
O=\begin{bmatrix}
0&0\
0&0
\end{bmatrix}
]
6. Identity Matrix
An identity matrix is a square matrix with 1s along its main diagonal and 0s elsewhere.
[
I=\begin{bmatrix}
1&0\
0&1
\end{bmatrix}
]
For a compatible matrix (A):
[
AI=IA=A
]
7. Diagonal Matrix
A diagonal matrix is a square matrix in which all off-diagonal elements are zero.
[
A=\begin{bmatrix}
2&0&0\
0&4&0\
0&0&6
\end{bmatrix}
]
8. Symmetric Matrix
A square matrix is symmetric when it is equal to its transpose.
[
A^T=A
]
Example:
[
A=\begin{bmatrix}
1&2\
2&3
\end{bmatrix}
]
Matrix Operations
Matrix operations are fundamental to linear algebra and mathematical computations. The most common operations include addition, subtraction, multiplication, scalar multiplication, transpose, determinant and inverse.
1. Matrix Addition
Matrix addition involves adding corresponding elements of two matrices.
Two matrices can be added only when they have the same dimensions.
Consider:
[
A=\begin{bmatrix}
1&2\
3&4
\end{bmatrix}
]
[
B=\begin{bmatrix}
5&6\
7&8
\end{bmatrix}
]
Adding the matrices:
[
A+B=
\begin{bmatrix}
1+5&2+6\
3+7&4+8
\end{bmatrix}
]
Therefore:
[
\boxed{
A+B=
\begin{bmatrix}
6&8\
10&12
\end{bmatrix}}
]
2. Matrix Subtraction
Matrix subtraction involves subtracting corresponding elements of one matrix from another.
The matrices must have the same dimensions.
Using the previous matrices:
[
A-B=
\begin{bmatrix}
1-5&2-6\
3-7&4-8
\end{bmatrix}
]
Therefore:
[
\boxed{
A-B=
\begin{bmatrix}
-4&-4\
-4&-4
\end{bmatrix}}
]
3. Matrix Multiplication
Matrix multiplication is performed by multiplying the rows of the first matrix by the corresponding columns of the second matrix and adding the products.
For matrix multiplication to be possible, the number of columns in the first matrix must equal the number of rows in the second matrix.
If:
[
A_{m\times n}\quad\text{and}\quad B_{n\times p}
]
Then:
[
AB=C_{m\times p}
]
Example:
[
A=\begin{bmatrix}
1&2\
3&4
\end{bmatrix}
]
[
B=\begin{bmatrix}
5&6\
7&8
\end{bmatrix}
]
Multiplying:
[
AB=
\begin{bmatrix}
1(5)+2(7)&1(6)+2(8)\
3(5)+4(7)&3(6)+4(8)
\end{bmatrix}
]
Therefore:
[
\boxed{
AB=
\begin{bmatrix}
19&22\
43&50
\end{bmatrix}}
]
An important property of matrix multiplication is that it is generally not commutative:
[
AB\ne BA
]
4. Scalar Multiplication
Scalar multiplication involves multiplying every element of a matrix by a constant number called a scalar.
Consider:
[
A=\begin{bmatrix}
1&2\
3&4
\end{bmatrix}
]
Multiplying by 3:
[
3A=
\begin{bmatrix}
3&6\
9&12
\end{bmatrix}
]
5. Matrix Transpose
The transpose of a matrix is obtained by interchanging its rows and columns.
It is represented by (A^T).
If:
[
A=\begin{bmatrix}
1&2&3\
4&5&6
\end{bmatrix}
]
Then:
[
\boxed{
A^T=
\begin{bmatrix}
1&4\
2&5\
3&6
\end{bmatrix}}
]
A matrix of order (m\times n) becomes a matrix of order (n\times m) after transposition.
6. Determinant of a Matrix
The determinant is a scalar value associated with a square matrix. It is represented by (\det(A)) or (|A|).
For a (2\times2) matrix:
[
A=\begin{bmatrix}
a&b\
c&d
\end{bmatrix}
]
The determinant is:
[
\boxed{\det(A)=ad-bc}
]
Example:
[
A=\begin{bmatrix}
2&3\
1&4
\end{bmatrix}
]
[
\det(A)=(2\times4)-(3\times1)
]
[
\boxed{\det(A)=5}
]
A determinant of zero indicates that a square matrix is singular and does not have an ordinary inverse.
7. Inverse of a Matrix
The inverse of a square matrix (A) is another matrix (A^{-1}) satisfying:
[
AA^{-1}=A^{-1}A=I
]
For a (2\times2) matrix:
[
A=\begin{bmatrix}
a&b\
c&d
\end{bmatrix}
]
Its inverse is:
[
\boxed{
A^{-1}=\frac{1}{ad-bc}
\begin{bmatrix}
d&-b\
-c&a
\end{bmatrix}}
]
The inverse exists only when:
[
\det(A)\ne0
]
Example:
[
A=\begin{bmatrix}
1&2\
3&4
\end{bmatrix}
]
Its determinant is:
[
\det(A)=1(4)-2(3)=-2
]
Therefore:
[
A^{-1}=
-\frac{1}{2}
\begin{bmatrix}
4&-2\
-3&1
\end{bmatrix}
]
[
\boxed{
A^{-1}=
\begin{bmatrix}
-2&1\
1.5&-0.5
\end{bmatrix}}
]
How to Use the Matrix Calculator
The exact steps depend on the operations and input format supported by the SOCE calculator. In general:
- Select the required matrix operation.
- Enter the dimensions of the matrix, if required.
- Input the matrix elements row by row.
- Enter a second matrix when the selected operation requires it.
- Select the calculate option.
- Review the resulting matrix or numerical value.
For example, to calculate the determinant of:
[
A=\begin{bmatrix}
2&3\
1&4
\end{bmatrix}
]
Select the determinant operation and enter the four matrix elements. The result is:
[
\boxed{\det(A)=5}
]
Always follow the input format and operation restrictions provided by the calculator.
Important Properties of Matrices
Understanding matrix properties helps simplify calculations and verify mathematical results.
| Operation | Important Property |
|---|---|
| Addition | (A+B=B+A) |
| Addition | ((A+B)+C=A+(B+C)) |
| Multiplication | ((AB)C=A(BC)) |
| Multiplication | Generally, (AB\ne BA) |
| Transpose | ((A^T)^T=A) |
| Transpose | ((AB)^T=B^TA^T) |
| Determinant | (\det(AB)=\det(A)\det(B)) |
| Inverse | (AA^{-1}=I) |
| Inverse | ((AB)^{-1}=B^{-1}A^{-1}), when both inverses exist |
Applications of Matrices
Matrices are widely used in mathematics, engineering, science and computer science.
- Structural Engineering: Used in stiffness matrix formulation, structural analysis, finite element methods and systems of equilibrium equations.
- Civil Engineering: Applied in structural modelling, coordinate transformations, surveying and numerical calculations.
- Finite Element Analysis: Element stiffness matrices are assembled into a global stiffness matrix to formulate structural systems.
- Computer Graphics: Used in geometric transformations, rotation, scaling and translation.
- Electrical Engineering: Applied in circuit analysis and systems of linear equations.
- Data Science: Used in data representation, machine learning and numerical computation.
- Physics: Applied in coordinate transformations, mechanics and mathematical modelling.
- Numerical Analysis: Used in solving large systems of linear equations and computational problems.
Frequently Asked Questions (FAQs)
1. What is a matrix calculator?
A matrix calculator is an online mathematical tool used to perform operations on matrices. Depending on its functionality, it may support addition, subtraction, multiplication, scalar multiplication, transpose, determinant and inverse calculations.
2. How do I multiply two matrices?
Multiply each row of the first matrix by each column of the second matrix and add the corresponding products. The number of columns in the first matrix must equal the number of rows in the second matrix.
3. How do I calculate the determinant of a 2×2 matrix?
For:
[
A=\begin{bmatrix}
a&b\
c&d
\end{bmatrix}
]
Use:
[
\det(A)=ad-bc
]
4. What is the inverse of a matrix?
The inverse is a matrix that produces the identity matrix when multiplied by the original matrix. A square matrix has an inverse only when its determinant is non-zero.
5. Can a rectangular matrix have an inverse?
A rectangular matrix does not have an ordinary two-sided matrix inverse. However, certain rectangular matrices may have a left inverse, right inverse or Moore–Penrose pseudoinverse under appropriate conditions.
6. What is a transpose matrix?
A transpose matrix is obtained by interchanging the rows and columns of the original matrix. It is represented by (A^T).
7. What is an identity matrix?
An identity matrix is a square matrix with 1s on its main diagonal and 0s in all other positions. It acts as the multiplicative identity for compatible matrices.
8. What is the difference between matrix addition and multiplication?
Matrix addition combines corresponding elements and requires matrices of equal dimensions. Matrix multiplication uses row-by-column products and requires the inner dimensions to match.
9. What is a singular matrix?
A singular matrix is a square matrix whose determinant is zero. It does not have an ordinary inverse.
Perform Matrix Calculations with SOCE
Use SOCE’s free online Matrix Calculator to make matrix calculations more convenient. It can be useful for students, teachers, engineers and anyone studying linear algebra, numerical analysis, structural engineering and computational mathematics.
Explore more free mathematical tools in the SOCE Advanced Mathematics collection.