Mathematics Previous page   Next Page

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.


Previous page  Creating Matrices Vector Products and Transpose Next page

© 1994-2005 The MathWorks, Inc.