function avg = average(v)
% Compute the average of items in a vector

sum = 0;
for k = 1:length(v)
	sum = sum + v(k);
end
avg = sum / length(v);
