How to calculate mean and standard deviation

665 ビュー (過去 30 日間)
mohd akmal masud
mohd akmal masud 2019 年 12 月 18 日
回答済み: MD Ashraful Islam 2022 年 1 月 27 日
Hi everyone, want to ask.
If I have set of data let say
X = [23,43, 45,90,15,41,71,29,45,52,32];
How to calculate the mean and standard deviation?

採用された回答

Star Strider
Star Strider 2019 年 12 月 18 日
Mean: mean
Standard Deviation: std
  10 件のコメント
Behzad Hosseinzadeh
Behzad Hosseinzadeh 2020 年 5 月 31 日
the standard deviation of those valuse are 20.386350967869, why MATLAB returns 21.38139?
Image Analyst
Image Analyst 2020 年 5 月 31 日
As you know, there are two standard deviations
  1. the standard deviation of the sample
  2. the standard deviation of the population
If you want the non-default formula, you have to tell it:
X = [23,43, 45,90,15,41,71,29,45,52,32];
sd = std(X) % Default
s0 = std(X, 0)
s1 = std(X, 1)
sd =
21.3813852770029
s0 =
21.3813852770029
s1 =
20.3863509678688
S = std(A,w) specifies a weighting scheme for any of the previous syntaxes. When w = 0 (default), S is normalized by N-1. When w = 1, S is normalized by the number of observations, N. w also can be a weight vector containing nonnegative elements. In this case, the length of w must equal the length of the dimension over which std is operating.

サインインしてコメントする。

その他の回答 (1 件)

MD Ashraful Islam
MD Ashraful Islam 2022 年 1 月 27 日
mean(X)
std(X)

Community Treasure Hunt

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

Start Hunting!

Translated by