%
%   Book: MATLAB-Based Electromagnetics (Pearson Prentice Hall)
%   Author: Branislav M. Notaros
%   Instructor Resources
%   (c) 2011
%
%   This MATLAB code or any part of it may be used only for 
%   educational purposes associated with the book
%
%
%


%  Dot product of two vectors


function [result] = dotProduct(A,B)
if (length(A)==length(B))
    result = 0;
    for i=1:length(A)
    result = result + A(i)*B(i);
    end
else disp ('Error - vector dimensions are not valid');
    result = 0;
end;
