%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)
//多值反回