How to calculate sample and population variances in Matlab?

后端 未结 2 1540
心在旅途
心在旅途 2021-01-18 02:21

I have a vector a

a = [86 100 41 93 75 61 76 92 88 97]

And I want to calculate the std and mean by

2条回答
  •  耶瑟儿~
    2021-01-18 02:52

    An unbiased sample variance is given by:

    >> 1/(length(a)-1) * sum((a-mean(a)).^2)
    
    ans =
    
      335.2111
    

    enter image description here

提交回复
热议问题