function y = average(x)
%AVERAGE Average value.
%    AVERAGE(X) is the average of the elements in the vector X.

% By Martin Trauth, Oct 6, 2009

[m,n] = size(x);
if m == 1
   m = n;
end
y = sum(x)/m;