function [sum,av]=mysum(a)
n=length(a);
sum=0.;
for i=1:n
sum=sum+a(i);
end
av=sum/n;
end