%sumOfArrayLoop(matrix<number>) -> number
%Author: James Atlas CISC106 8am
%Description:
%  Takes a matrix of numbers and computes the sum.
%Examples:
%  sumOfArrayLoop([1 2 3 4]) -> 10
%  sumOfArrayLoop([-5 5 0 1]) -> 1
%  sumOfArrayLoop([1.1 2.2 3.3 4.4 5.5]) -> 16.5
function out=sumOfArrayLoop(numMatrix)
out = 0;
index = 1;
while (index <= length(numMatrix))
    out = numMatrix(index) + out;
    index = index + 1;
end