function [average,sd]=fun1(n)

temp=rand(1,n);
average = avg(temp,n);
sd = sqrt(sum((temp-avg(temp,n)).^2)/n);

%-------------------------
function average= avg(x,n)
average = sum(x)/n; %MEAN subfunction

