home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-20 | 426 b | 19 lines | [TEXT/RLAB] |
- //---------------------------------------------------------------------------
- // dot.r
-
- // Syntax: dot ( A , B )
-
- // Description:
-
- // Compute the dot product of two vectors, A and B.
- //---------------------------------------------------------------------------
-
- dot = function ( A , B )
- {
- if (min (size (A) != 1) || min (size (B) != 1))
- {
- error ("dot: A and B must be vectos");
- }
- return sum (A[:] .* B[:])
- };
-