Matrix Calculator
This comprehensive matrix calculator performs a wide range of operations on matrices, including addition, subtraction, multiplication, finding the determinant, and calculating the inverse. Set the dimensions of Matrix A and Matrix B, fill in the values, and select an operation to get started.
Matrix A
Matrix B
Operations
Result
How to Use the Matrix Calculator
- Set Dimensions: Adjust the "Rows" and "Cols" for Matrix A and Matrix B to your desired size. The input grids will update automatically (max 10x10).
- Fill in Values: Enter the elements for each matrix. You can use integers (5), decimals (2.5), or fractions (1/2).
- Select Operation: Click the button for the operation you want to perform (e.g., [A + B], [A × B], [det(A)]).
- View Result: The result will be displayed in the "Result" section. If the operation is mathematically impossible (like adding matrices of different sizes), an error message will appear.
Understanding Matrix Operations
A matrix is a rectangular array of numbers arranged in rows and columns. This calculator supports the fundamental operations of linear algebra.
Matrix Addition and Subtraction (A ± B)
To add or subtract two matrices, they must have the **exact same dimensions**. The operation is performed by adding or subtracting the corresponding elements.
$(A - B)_{ij} = A_{ij} - B_{ij}$
Matrix Multiplication (A × B)
To multiply Matrix A (dimensions $m \times n$) by Matrix B (dimensions $p \times q$), the number of **columns in A ($n$) must equal the number of rows in B ($p$)**. The resulting matrix will have dimensions $m \times q$.
This means each element $(AB)_{ij}$ is the dot product of the $i$-th row of A and the $j$-th column of B. Note that matrix multiplication is **not commutative** (A × B ≠ B × A).
Determinant of a Matrix (det(A))
The determinant is a scalar value that can only be computed for a **square matrix** (e.g., 2x2, 3x3). It provides important information about the matrix, such as whether it is invertible.
- For a 2x2 matrix: $\text{det}(A) = ad - bc$
- For a 3x3 matrix (Cofactor Expansion):
$\text{det}(A) = a(ei - fh) - b(di - fg) + c(dh - eg)$
Inverse of a Matrix (A⁻¹)
The inverse of a matrix A, denoted $A⁻¹$, is a matrix such that $A \times A⁻¹ = I$ (the identity matrix). An inverse only exists if the matrix is **square** and **non-singular** (its determinant is not zero).
Where $C^T$ is the transpose of the cofactor matrix (also known as the adjugate or classical adjoint of A). If $\text{det}(A) = 0$, the matrix is singular and has no inverse.
Transpose of a Matrix (Aᵀ)
The transpose of a matrix is found by swapping its rows and columns. The element at $A_{ij}$ becomes the element at $(A^T)_{ji}$.