function [a,b,c] = innprod(x,y);
% [a,b,c] = innprod(x,y) - three versions to compute the inner product 
% of two vectors x,y  
% x,y must be column vector of the same length

n = length(x);
m= length(y);
if n ~= m;
  disp('vectors must be of same length');
  % RETURN causes a return to the invoking function or to the keyboard  
  return
end

% 1. version
tic
a=0;
for j=1:m;
  a = x(j)*y(j)+a;
end
toc

% 2. version
 
tic
b = sum(x.*y);
toc

% 3. version

tic
c = x'*y;
toc

