| Mathematics | ![]() |
Adding and Subtracting Matrices
Addition and subtraction of matrices is defined just as it is for arrays, element-by-element. Adding A to B and then subtracting A from the result recovers B.
Addition and subtraction require both matrices to have the same dimension, or one of them be a scalar. If the dimensions are incompatible, an error results.
| Creating Matrices | Vector Products and Transpose | ![]() |
© 1994-2005 The MathWorks, Inc.