sim=100000; %add=0; s=zeros(sim,1); for i=1:sim s(i)=6*(1+normrnd(0,0.2)); end mu=sum(s)/sim %平均值 sum((s-mu).^2/sim)^.5 %标准差