function sum = mysum_while(x)
%  inputs:
%     x: vector
%  outputs:
%     sum: 

sum = 0;
n = 1; % the loop counter

while n <= length(x) 

   sum = sum + x(n);

   n = n+1;
end %end


return; 
