Matlab is calculating the standard deviation differently

MATLAB

I want to understand why Matlab is giving me a wrong answer when I ask for the standard deviation.
For example, I was trying to get the standard deviation of this matrix:

It doesn't make sense, because the first column $[1;4;7]$ gives me $3$ and the standard deviation is $\sqrt6$. I stuck there and I didn't even try to calculate the other standard deviations.
What is happening? is Matlab using another formula for standard deviation other than the classical one? or it's rounding the number $\sqrt6$ to $3$?
I need help, thank you!

Best Answer

Matlab uses the sample standard deviation. That is, it divides by $n-1$ rather than $n$ to estimate the variance, because this gives an unbiased estimator of the variance. Taking the square root then gives the sample standard deviation.

Unfortunately, an unbiased estimator of the variance does not lead to an unbiased estimator of the standard deviation.

Related Question