Let P and Q be two matrices of same dimension m × n.
Then their difference is the matrix of dimension m × n, obtained by subtracting the entries of Q from the corresponding entries of P. It is denoted by P − Q
Thus, if P = (pij)m × n and Q = (qij)m × n
P − Q = [pij − qij]m × n
If the matrices are not of the same dimension, the subtraction of matrices is not defined.
Note that subtraction of matrices (like normal subtraction) is neither commutative nor associative.
i.e, A – B ≠ B – A
A – (B – C) ≠ (A – B) – C