dot
Dot product
Description
C = dot(
returns
the scalar dot
product of A,B
)A
and B
.
If
A
andB
are vectors, then they must have the same length.If
A
andB
are matrices or multidimensional arrays, then they must have the same size. In this case, thedot
function treatsA
andB
as collections of vectors. The function calculates the dot product of corresponding vectors along the first array dimension whose size does not equal 1.
Examples
Input Arguments
More About
Algorithms
When inputs
A
andB
are real or complex vectors, thedot
function treats them as column vectors anddot(A,B)
is the same assum(conj(A).*B)
.When the inputs are matrices or multidimensional arrays, the
dim
argument determines which dimension thesum
function operates on. In this case,dot(A,B)
is the same assum(conj(A).*B,dim)
.
Extended Capabilities
Version History
Introduced before R2006a