Addition and Scalar Multiplication
Addition and subtraction are element-wise, so you simply add or subtract each corresponding element:
To add or subtract two matrices, their dimensions must be the same.
Matrix scalar multiplication
In scalar multiplication, we simply multiply every element by the scalar value:
Add Scalar to a Matrix
What happens if we have a Matrix + scalar? The scalar value is added to each entry of A.
A = [0 1; 1 0] C = A + 2 C = 2 3 3 2