function statn
clc
m = 6;
logn=zeros(m,1);
nx=zeros(m,1);
mx=zeros(m,1);
sx=zeros(m,1);
fprintf('\nMean and Std-dev vs. n for MATLAB randn');
fprintf('\n      n         xmean           xstd');
for k=1:m
   randn('state',0);
   logn(k)=k;
   nx(k)=10^k;
   x=randn(nx(k),1);
   mx(k)=mean(x);
   sx(k)=std(x);
   fprintf('\n%7i        %10.3e      %10.3e',nx(k),mx(k),sx(k));
end
plot(logn,mx,'b-o',logn,sx,'r-^','linewidth',3);
grid on
htitle=title('Mean and Std-dev vs. log(n) for randn');
hxlabel=xlabel('k=log10(n)');
hylabel=ylabel('Mean and sStd-deviation');
hlegend=legend('Mean','Std-dev',0);
set(htitle,'Fontsize',24,'FontName','Helvetica','FontWeight','Bold');
set(hylabel,'Fontsize',24,'FontName','Helvetica','FontWeight','Bold');
set(hxlabel,'Fontsize',24,'FontName','Helvetica','FontWeight','Bold');
set(hlegend,'Fontsize',24,'FontName','Helvetica','FontWeight','Bold');
set(gcf,'Color','White');
set(gca,'Fontsize',20,'FontName','Helvetica','FontWeight','Bold','linewidth',2);