Matrix Addition and Subtraction
Now that we've discussed checking for equal matrices, addition and subtraction will follow quite naturally. The preceding section said that corresponding entries are positioned in the same row and column location, and if two matrices are the same size with equal corresponding entries, they must be equal. For you to add matrices, they must also have the same dimensions. You just add corresponding entries.
Adding MatricesFor two matrices of the same size, add the corresponding entries. |
NOTE
Always remember that two matrices must have the same dimensions for you to add them (just like equal matrices).
Also, some math texts refer to a matrix's dimensions as its order, so don't be thrown if you see that term used. ...
Get Beginning Math and Physics for Game Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.