Obj-C: Calculate the standard deviation of an NSArray of NSNumber objects?

前端 未结 6 1801
心在旅途
心在旅途 2020-12-28 21:04

If I have an NSArray of NSNumber objects, how do I calculate the standard deviation of the numbers in the array?

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-28 21:48

    Here's a link to an algorithm you could use. I don't know of any built-in Objective C statistics libraries, so I would just implement the algorithm myself. The link does it in Java, but it should be easy to convert.

提交回复
热议问题