Hi, I am just learning about dot products. Why is the built in function dot(u,v) returning the complex conjugate of what I think the right answer is (and the answer in my Professors notes).

x = (2; 1 + i; i)

y = (2 - i; 2; 1 + 2i)

< x; y >= 2(2 + i) + (1 + i)(2) + i(1 - 2i) = 4 + 2i + 2 + 2i + i - 2i^2 = 8 + 5i

but:

EDU>> x=[2,1+i,i]; y=[2-i,2,1+2i];

EDU>> dot(x,y)

ans =

8 - 5i <-- wrong answer

note, though:

EDU>> dot(y,x) <-- backwards

ans =

8 + 5i <-- right answer

For two column vectors x and y, dot is defined as x' * y. The first vector is conjugated. In addition to MATLAB, that is also the way the dot product is defined in other languages as well, e.g. Fortran. So MATLAB is being consistent with other languages.

James Tursa

If I remember correctly, for a Hermitian product, the choice of which vector to conjugate is arbitrary. I have seen it both ways.

Thanks.

My textbook and teacher conjugates the second one (or I'm reading it wrong - I haven't had anything to do with complex numbers since HS over a decade ago). I guess learning which one to conjugate is a subject for the future (or a question for my prof).

Oh wait (don't read that last post!). You can define many dot products in a vector space. :D.

1. Dragging Dot Net Components to Non Dot Net Components

2. dot product and vectors with imaginary numbers

3. ANN: OPEN OFFICE DOT ORG THREE DOT THREE DOT ZERO IS NOW RTW!

4. dots dots.....those crazy dots

5. The dot product and cross product

6. Fastest way to compute dot product (inner product) in Ruby?

7. send.me.spam@hotmail.co.uk thats send dot me dot spam at hotmail dot co dot uk

8. what is the difference between the vb dot net and asp dot net

9. dot.net = dot.crap when it comes to install problems

10. Dot Net Project Execution without Dot Net and Framework....

11. dot plot - single x axis location with multiple y axis dots

12. Leading dots...trailing dots

13. Save a dot as doc and it opens with the userform from the dot!

5 post • Page:**1** of **1**