Page 242 -
P. 242

A=[1 2 3 4];
                                B=[5 6 7 8];
                                A+B
                             produces

                                ans =
                                     681012

                             If we had subtraction of two matrices, it would be the same syntax as above
                             but using the minus sign between the matrices.






                             8.3  Multiplying a Matrix by a Scalar
                             If we multiply a matrix by a number, each element of the matrix is multiplied
                             by that number.

                             Entering:

                                3*A

                             produces

                                ans =
                                     36912
                             Entering:

                                3*(A+B)

                             produces

                                ans =
                                     18  24   30  36





                             8.4  Multiplying Matrices

                             Two matrices A(m ⊗ n) and B(r ⊗ s) can be multiplied only if n = r. The size
                             of the product matrix is (m ⊗ s). An element of the product matrix is obtained
                             from those of the constitutent matrices through the following rule:


                             © 2001 by CRC Press LLC
   237   238   239   240   241   242   243   244   245   246   247