Add/Sub/Hadamard: Same dimensions. Multiply: cols(A) = rows(B). Det/Inv/Trace: Square matrix.
Configure matrices and click Compute
- Choose mode :- Select "Single Matrix (A)" for individual operations or "Two Matrices (A & B)" for dual operations
- Set dimensions :- Choose rows and columns (1-4) for each matrix using the dropdowns
- Enter values :- Click each cell and type numbers, or use "Random" / "Identity" buttons to auto-fill
- Select operation :- Pick from Determinant, Inverse, Transpose, Trace, Scalar, Add, Subtract, Multiply, or Hadamard
- Click Compute :- View the result with step-by-step explanation on the right panel
Note: Maximum matrix size is 4×4. For Determinant, Inverse, and Trace, the matrix must be square (rows = cols).
Determinant (det(A))
For a 2×2 matrix: det(A) = ad - bc
For larger matrices, uses cofactor expansion along the first row.
Inverse (A⁻¹)
A⁻¹ = (1/det(A)) × adj(A), where adj(A) is the adjugate (transpose of cofactor matrix). Only exists if det(A) ≠ 0.
Transpose (Aᵀ)
Swap rows with columns: Aᵀ[i][j] = A[j][i]. Rows become columns and vice versa.
Trace (tr(A))
Sum of diagonal elements: tr(A) = Σ A[i][i] for i = 0 to n-1.
Addition (A + B)
Element-wise addition: (A + B)[i][j] = A[i][j] + B[i][j]. Matrices must have same dimensions.
Multiplication (A × B)
(A × B)[i][j] = Σ A[i][k] × B[k][j] for k = 0 to cols(A). cols(A) must equal rows(B).
Scalar Multiplication
(c × A)[i][j] = c × A[i][j]. Multiply every element by the scalar constant.
Hadamard Product
(A ⊙ B)[i][j] = A[i][j] × B[i][j]. Element-wise multiplication, same as Addition dimensions.