%stats.m
function [mean,stdev]=stats(x)
n=length(x);
mean=sum(x)/n;
stdev=sqrt(sum((x-mean).^2/(n-1)));
// command window
>>y=[8 5 10 12 6 7.5
4];
>> [m,s]=stats(y)
//多值反回
工程与科学数值方法的Matlab实现,布布扣,bubuko.com
原文:http://www.cnblogs.com/fooxer/p/3619175.html