%% Dot Product of Real Vectors
% Create two simple, three-element vectors.

A = [4 -1 2];
B = [2 -2 -1];

%
% Calculate the dot product of A and B.

C = dot(A,B)

% The result is 8 since
%   C = A(1)*B(1) + A(2)*B(2) + A(3)*B(3)
% Copyright 2012 The MathWorks, Inc.