%% Dot Product of Complex Vectors
% Create two complex vectors.

A = [1+i 1-i -1+i -1-i];
B = [3-4i 6-2i 1+2i 4+3i];

%
% Calculate the dot product of A and B.

C = dot(A,B)

% The result is a complex scalar since A and B are complex. In general, the dot product of two complex vectors is also complex. An exception is when you take the dot product of a complex vector with itself.
%
% Find the inner product of A with itself.

D = dot(A,A)

% The result is a real scalar. The inner product of a vector with itself is related to the Euclidean length of the vector, norm(A).
% Copyright 2012 The MathWorks, Inc.