Page 208 -
P. 208

u = [1537]and v = [2468]

                             Solution: Type and execute each of the following commands, while interpret-
                             ing each output:

                                u=[1 5 3 7]
                                v=[2 4 6 8]
                                u*v'
                                v'*u
                                u*v                 %you cannot multiply two rows
                                u'*v
                                u*u'
                                (norm(u))^2
                              As observed from the above results, in MATLAB, the dot product can be
                             obtained only by the multiplication of a row on the left and a column of the
                             same length on the right. If the order of a row and column are exchanged, we
                             obtain a two-dimensional array structure (i.e., a matrix, the subject of Chap-
                             ter 8). On the other hand, if we multiply two rows, MATLAB gives an error
                             message about the non-matching of dimensions.
                              Observe further, as pointed out previously, the relation between the length
                             of a vector and its dot product with itself.



                             In-Class Exercises

                             Pb. 7.2 Generalize the analytical technique, as previously used in Example
                             7.4 for finding the normal to a line in 2-D, to find the unit vector in 3-D that
                             is perpendicular to the plane:

                                                      ax + by + cz + d = 0

                             (Hint: A vector is perpendicular to a plane if it is perpendicular to two non-
                             collinear vectors in that plane.)
                             Pb. 7.3 Find, in 2-D, the distance of the point P(x , y ) from the line ax + by
                                                                            0
                                                                         0
                             + c = 0. (Hint: Remember the geometric definition of the dot product.)
                             Pb. 7.4 Prove the following identities:

                                       r r   r r  r r   r   r r   r r     r r     r r
                                       uv⋅=  v u⋅ ,  u v⋅(  +  w =)  u v u w⋅ + ⋅ ,  k uv⋅(  ⋅ )  = ( ku v⋅)







                             © 2001 by CRC Press LLC
   203   204   205   206   207   208   209   210   211   212   213