[TOC]

dot

Dot product

Usages

C = dot(A, B)

C = dot(A, B, k)

Example

Input
a = randi(3,3,4)
b = randi(3,3,4)

% Dot products of vectors along the first
% non-singleton dimension.
dot(a,b)

% Dot products of vectors along the
% second dimension.
dot(a,b,2)
Output
a = 
 2.0000   3.0000   3.0000   3.0000
 3.0000   2.0000   2.0000   1.0000
 2.0000   2.0000   2.0000   3.0000

b = 
 2.0000   1.0000   1.0000   1.0000
 2.0000   1.0000   1.0000   1.0000
 2.0000   1.0000   2.0000   3.0000

ans = 
 14.000   7.0000   9.0000   13.000

ans = 
 13.000
 11.000
 19.000