format long
x=100*ones(100,1)+1e-5*(rand(100,1)-0.5);
s=0; sq=0; n=0;
while n<length(x),
  n=n+1;
  s=s+x(n);
  sq=sq+x(n)^2;
  mu=s/n;
end
means=[mu mean(x)]
sigma2=sq/n-mu^2;
variances=[sigma2 var(x,1)]
sigma=sqrt(sigma2);
standarddev=[sigma std(x,1)]