Matlab:
>> std( [3 2 2 3] )
ans =
0.5774
Layman\'s interpretation of standard deviation per Google:
Mean of {3,2,2,3}
Matlab std
computes the corrected standard deviation. From help std
:
std normalizes Y by (N-1), where N is the sample size. This is the sqrt of an unbiased estimator of the variance of the population from which X is drawn, as long as X consists of independent, identically distributed samples.
So you have
Square of deviation from mean = {0.25, 0.25, 0.25, 0.25}
Then you don't compute the actual root mean of the deviations, but sqrt(sum([0.25 0.25 0.25 0.25])/3)
. Generally, sum(square of deviation)/(N-1)
for a vector of length N
.
Update: as Leonid Beschastny pointed out, you can get matlab to calculate the uncorrected standard deviation. Again, from help std
:
Y = std(X,1) normalizes by N and produces the square root of the second moment of the sample about its mean. std(X,0) is the same as std(X).