MATLAB: Simple question about Standard Deviation.

standard deviationstatistics

I have a number of data points, lets say in a vector v, and lets say there are "num" of them. If I write sd = std(v) did it assume a sample i.e. it used num-1 (in the denominator) or did I get a population standard dev i.e. it used num? How can I request one or the other?

Best Answer

By default, it will give the sample standard deviation. Call it as
std(x,1)
to get the population. That is explained in the documentation for std, in the section describing the input argument weight.
Related Question