function res = mean(x)
  sum = 0;
  for entry = x,
    sum = sum + entry;
  end
  res = sum / length(x);
end

