Math
Matrix operations.
Definition
The basic operations performed on matrices including addition, subtraction, scalar multiplication, and matrix multiplication. Matrices must have compatible dimensions for addition/subtraction (same size) and multiplication (columns of first = rows of second).
How it works · 4 phases
Step by step.
- For addition/subtraction: add or subtract corresponding entries (matrices must be same size).
- For scalar multiplication: multiply every entry by the scalar.
- For matrix multiplication: take the dot product of each row of the first matrix with each column of the second.
- The result of multiplying an m×n matrix by an n×p matrix is an m×p matrix.
Examples
Real-world.
- 1 Adding two 2×2 matrices by adding corresponding entries
- 2 Multiplying a matrix by 3 (scalar multiplication)
- 3 Multiplying a 2×3 matrix by a 3×2 matrix to get a 2×2 result