%
% average.m
%
% Find the average of an array of numbers.
% MCW, Spring 2005
%
function avg = average(x)

mysum = 0;
for k=1:length(x)
    mysum = mysum + x(k);
end
avg = mysum/k;
