Cody

# Problem 3005. Recursive Standard Deviation

Solution 703624

Submitted on 20 Jul 2015 by James
• Size: 22
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% std_p=0.5 mean_p=0.5 mean_n=2/3 value=1 y_correct=0.4714 assert(abs(recursive_std(std_p,mean_p,mean_n,value)-y_correct)<1e-4)

std_p = 0.5000 mean_p = 0.5000 mean_n = 0.6667 value = 1 y_correct = 0.4714 ans = 0.4714

2   Pass
%% std_p=.5 mean_p=1.5 mean_n=2 value=3 y_correct=0.8165 assert(abs(recursive_std(std_p,mean_p,mean_n,value)-y_correct)<1e-4)

std_p = 0.5000 mean_p = 1.5000 mean_n = 2 value = 3 y_correct = 0.8165 ans = 0.8165

3   Pass
%% std_p=5 mean_p=4 mean_n=7.6667 value=15 y_correct=6.5997 assert(abs(recursive_std(std_p,mean_p,mean_n,value)-y_correct)<1e-4)

std_p = 5 mean_p = 4 mean_n = 7.6667 value = 15 y_correct = 6.5997 ans = 6.5997

### Community Treasure Hunt

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

Start Hunting!