function y=avg1(x)           % avg1.m
  y=mysum(x)/length(x);

function y=mysum(x)          % subfunction mysum
   y=sum(x);
