Matrix Calculator | Add, Subtract & Multiply Matrices

Calculate matrix addition, subtraction, and multiplication online.

Addition (A + B)

How to Use

  • Enter the elements of Matrix A and Matrix B in the text areas.
  • Use spaces or commas to separate numbers in a row, and use new lines for each row.
  • Example: 1 2 3 4
  • Select the desired operation (Addition, Subtraction, or Multiplication).
  • Click 'Calculate' to view the resulting matrix.

About Matrix Arithmetic

Matrix operations are fundamental in linear algebra, used to perform calculations on multidimensional grids of numbers.

Matrix Addition and Subtraction

Addition and subtraction are performed element-wise. Therefore, both matrices must have exactly the same dimensions (number of rows and columns). If A and B are m×n matrices, their sum A+B (or difference A-B) is also an m×n matrix.

Matrix Multiplication

To multiply Matrix A by Matrix B, the number of columns in A must equal the number of rows in B. If A is an m×n matrix and B is an n×p matrix, their product AB is an m×p matrix. The element in the i-th row and j-th column of AB is computed by taking the dot product of the i-th row of A and the j-th column of B.

Key Properties

  • Addition is commutative: A + B = B + A
  • Addition is associative: (A + B) + C = A + (B + C)
  • Multiplication is NOT generally commutative: AB ≠ BA
  • Multiplication is associative: (AB)C = A(BC)

Applications

  • Computer Graphics: 2D and 3D transformations (rotation, scaling, translation).
  • Physics: Quantum mechanics and structural analysis.
  • Economics: Input-output models.
  • Machine Learning: Neural network weight transformations and optimization algorithms.