keisoku

Matrix Addition & Subtraction Calculator

Add or subtract two same-size matrices element by element. Toggle between sum and difference and view the result as a table.

Input

Each line is one row of the matrix. Separate entries with spaces or commas.

Result

Operation

Sum A + B

Size (rows × cols)

2 × 3

Elements

6

Result matrix

81012
579

How it works

  • For two matrices A and B of the same size, the sum is C[i][j] = A[i][j] + B[i][j] and the difference is C[i][j] = A[i][j] − B[i][j]; corresponding entries are added or subtracted element by element.
  • Each input line is one row of the matrix, and entries in a row are separated by spaces, tabs, or commas. Blank lines are ignored.
  • Addition and subtraction are only defined when matrix A and matrix B have the same dimensions (rows × columns); mismatched sizes produce an error.
  • If the rows of a matrix do not all have the same number of entries (columns), an error is shown. Keep every row the same width.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Matrix Addition & Subtraction Calculator