Cody

Solution 1572145

Submitted on 30 Jun 2018 by Srishti Saha
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
x = 1:10; y_correct = 3.4142; assert(abs(h_mean(x)-y_correct)<0.0001)

harmonic_mean = 3.4142

2   Pass
x = 1:5; y_correct = 2.1898; assert(abs(h_mean(x)-y_correct)<0.0001)

harmonic_mean = 2.1898

3   Pass
x = 10; y_correct = 10; assert(abs(h_mean(x)-y_correct)<0.0001)

harmonic_mean = 10

4   Pass
x = 1:50; y_correct = 11.1131; assert(abs(h_mean(x)-y_correct)<0.0001)

harmonic_mean = 11.1131

5   Pass
x = 1:100; y_correct = 19.2776; assert(abs(h_mean(x)-y_correct)<0.0001)

harmonic_mean = 19.2776