MATLAB: More efficient dot product function.

dotdot productefficiencylinear algebramatrix operations

Hello,
I am just wondering if anyone knows a more efficient function than the dot from MATLAB. I am running a very robust simulator that needs to compute over 3 million dot products (and possibly even more for different cases) throughout the course of the simulation. This leads to the dot products taking up the second most amount of time out of the many functions called by the simulator. I suspect that a lot of the time spent in the dot function is being wasted checking to make sure the vectors are properly sized.
Thanks for your help!

Best Answer

Are you using the function dot(x,y) ?
If that's so, better use
x'*y (assuming that x and y are column vectors)
In my computer, x'*y is twice faster than sum(x.*y) and twenty times faster than dot(x,y). Good luck.