% Calculate a cumulative sum from a to b
function total = csum(nums)
    total = 0;
    for i=1:numel(nums)
        total = total + nums(i);
    end
end
