MATLAB: Std in matlab different from stdevp in excel

meanstd

I have an array of prices i calculated the standard deviation and the mean in matlab but the results are very different from what i calculated using excel. any reason why this is the case?

Best Answer

I get the same answer for stddev and mean from MATLAB and Excel
a = [ 1 1 1 1 1 3 2 4 5 6 2 6 2 6 1]
>> std(a)
ans =
2.04
>> mean(a)
ans =
2.80
From Excel the results are
stdev(a1:a15) = 2.042407543 and mean 2.8
do not know why you are facing a discrepancy. Are you certain that you are using the same identical data sets.
Related Question