% Unit 2 (MATLAB Course @ UAM)
% (c) Alexander Knebe

%=================================================================
% my_sum(x)
%=================================================================
function [z] = my_sum(x)
% Calculate the sum of all elements in vector x

z=0.;
for i=1:length(x)
    z=z+x(i);
end

end
