When you have a large set of data, it can be resource consuming to calculate standard deviation at every step. So why not calculate a recursive std deviation at step n given:
- mean at step n
- value of added point at step n
- mean and std at step (n-1)
PS1: We'll always consider a vector of length 2 to which we add a third value
PS2: There are two common definitions of stdandard deviation. If you look at the help section of matlab, i used the second definition
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers19
Suggested Problems
-
How to find the position of an element in a vector without using the find function
2816 Solvers
-
Is my wife right? Now with even more wrong husband
1346 Solvers
-
Back to basics 9 - Indexed References
463 Solvers
-
Get the length of a given vector
13440 Solvers
-
Number of odd and even elements within matrix
161 Solvers
More from this Author12
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!