dot product

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a built in function in excel 2003 for the dot product of two vectors? One can calculate it using multiple functions. If both vectors are oriented either by row or by column one can use {=sum(v1*v2)}. If one is oriented by row and the other by column one can calculate {=sum(v1*transpose(v2)}. But these can become a bit confusing. Why not a function {=dot(v1,v2)} without worrying about orientation?
Thanks for your help
 
Sounds from your first example that you've missed SUMPRODUCT.

However, it requires that both arguments be the shame shape. If they aren't,
you need to use TRANSPOSE *and* array enter it:

=SUMPRODUCT(A1:B1,TRANSPOSE(C1:C2))

You need CTRL+SHIFT+ENTER here.

Is there a built in function in excel 2003 for the dot product of two
vectors? One can calculate it using multiple functions. If both vectors are
oriented either by row or by column one can use {=sum(v1*v2)}. If one is
oriented by row and the other by column one can calculate
{=sum(v1*transpose(v2)}. But these can become a bit confusing. Why not a
function {=dot(v1,v2)} without worrying about orientation?
 
If I am not mistaken, another option might be:

=MMULT(A1:C1,E1:E3)

Dana DeLouis
 
No; That would return a 3x3 matrix. The dot product (or inner product as some call it) is just a number.
 
You are right myrna, I didn't know about SUMPRODUCT but it amounts to the same thing. Microsoft gives all the necessary tools for working with matricies; why not an easy way to calculate the dot product of two vectors, the result of which is just a number? But thanks for your suggestion.
 
If I am not mistaken, make sure the Horizontal array goes first, then the
Vertical array. You get a 3*3 if the other way around. Hope I said this
right. :>)

HTH
Dana DeLouis

LesHurley said:
No; That would return a 3x3 matrix. The dot product (or inner product as
some call it) is just a number.
 
Just to mention, both the following return 70.
Note however that the second array uses ";" to indicate a verticle array
(U.S. version anyway)

=MMULT({1,2,3,4},{5;6;7;8})

=SUMPRODUCT({1,2,3,4},{5,6,7,8})

Both return 70.

As a check with another program...

Dot[{1,2,3,4},{5,6,7,8}]
70

HTH :>)
Dana DeLouis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top