function res = average(vec)
res = sum(vec)./length(vec);