function result = mySum2(x)
% mySum2   return the sum of a vector
%
% Examples:
%    >> mySum2([3 2 7])
%    ans = 12
%    >>
%    >> mySum2([])
%    ans = 0
%    >>
% P. Conrad for CISC106 10/29/07
  
  
  if ( isempty(x)  )
    result = 0;
  elseif ( length(x) == 1)
    result = x;
  else
    result =  x(1) +  mySum2 (x(2:end));
  end
  
  return;
  
end
  