MATLAB: How to obtain the standard deviation of a column matrix

standard deviation

Hi, i have the following code data=randn(10,1); std(data,[],2); This will return a column matrix with only zeroes. My data is a matrix of dimension N x 1, with N >1000. I would like to know the Standard deviation for each row.

Best Answer

What is the standard deviation of one number? Going to the definition of standard deviation on Wikipedia, "For a finite set of numbers, the standard deviation is found by taking the square root of the average of the squared deviations of the values from their average value."
You only have one value in your finite set of numbers, so that value is the average value of the set. The deviation of that value from itself is 0. The square root of the average of the square of 0 is 0. So the result you receive from MATLAB is correct for the question you asked.
If you clarify what you're actually trying to do in more detail, we may be able to help you answer the question you want to ask.