Calculate 2 standard deviations

46 次查看(过去 30 天)
I am trying to calculate +/- two standard deviations from the mean of a bunch of values. I am not sure if I am using the standard deviation function properly. Would I just multiply by two to get 2 standard deviations?
dmean = mean(values(:,1)); upperstd = dmean+2*std(values(:,1)); lowerstd = dmean-2*std(values(:,1));

采纳的回答

Wayne King
Wayne King 2011-8-28
Hi Chris, for a matrix of data
x = randn(10,4);
mean(x)+2*std(x)
mean(x)-2*std(x)
gives the sample means of the columns plus/minus 2 times the standard deviation. The question is whether you really want the sample standard deviation here, or the standard error of the mean.
Wayne
  2 个评论
jay yawson
jay yawson 2019-6-17
Hello Wayne King. In this case, how would you calculate the standard error of the mean?
Thomas To
Thomas To 2020-1-20
Jay, the standard error is calculated by taking the standard deviation and dividing it by the square root of N-th samples used to calculate the standard deviation.

请先登录,再进行评论。

更多回答(1 个)

bym
bym 2011-8-28
that is correct

类别

Help CenterFile Exchange 中查找有关 Signal Processing Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by