What’s a Matrix?
A matrix (plural = matrices) is just a grid or table of numbers, arranged in rows and
columns.
Example of a 2x3 matrix (2 rows, 3 columns):
css
CopyEdit
[ 1 2 3 ]
[ 4 5 6 ]
📏 Matrix Size
You write the size of a matrix as:
rows × columns
So the one above is 2×3.
🔥 Types of Matrices:
1. Row matrix – Only 1 row
2. Column matrix – Only 1 column
3. Square matrix – Same number of rows and columns (like 2×2, 3×3)
4. Zero matrix – All elements are zero
5. Diagonal matrix – Non-zero only on the diagonal
6. Identity matrix (I) – Diagonal = 1s, rest = 0s
csharp
CopyEdit
[1 0]
[0 1]
🧠 Matrix Operations:
1. Addition/Subtraction ➕➖
o Same size only!
o Add/subtract element by element
2. Scalar Multiplication 🔢×🧮
o Multiply every element by a single number (a scalar)
3. Matrix Multiplication 🧠💥
o Multiply row × column
o Only works if columns in A = rows in B
o Resulting matrix: rows of A × columns of B
4. Transpose (Aᵀ)
o Flip rows into columns and vice versa
ini
CopyEdit
A = [1 2] Aᵀ = [1 3]
[3 4] [2 4]
5. Determinant & Inverse (for square matrices only)
o Used in solving systems, more advanced stuff
🤖 Applications:
Solving equations (systems of linear equations)
Computer graphics & 3D transformations
Cryptography
Data science and ML
Animations & simulations