Skip to content

Instantly share code, notes, and snippets.

@hongyangqin
Created January 6, 2018 05:17
Show Gist options
  • Save hongyangqin/68669a7351d4fb08a325fbaf38b3670d to your computer and use it in GitHub Desktop.
Save hongyangqin/68669a7351d4fb08a325fbaf38b3670d to your computer and use it in GitHub Desktop.
MATLAB std() 标准偏差函数

MATLAB std() 标准偏差函数

from : http://blog.sina.com.cn/s/blog_728fa7830101cuv2.html

函数std(x),算出x的标准偏差。x可以是一行的matrix或者一个多行matrix,如果只有一行,那么就是算一行的标准偏差,如果有多行,就是算每一列的标准偏差。

std(x,a)也是x的标准偏差,但是a可以=0或者1.如果是0和前面没有区别,如果是1就是最后除以n,而不是n-1.(你参考计算标准偏差的公式,一般都用除以n-1的公式。)

std (x, a, b) 这里a表示是要用n还是n-1,如果是a是0就是除以n-1,如果是1就是除以n。b这里是维数,如果b是1,就是按照列分,如果b是2就是按照行分,如果是三维的矩阵,b=3就按照第三维来分数据。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment