Cody

Solution 1030153

Submitted on 24 Oct 2016 by goc3
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; n=1; y_correct = 1; assert((nroot(n,x)-y_correct)<0.001)

ans = 1

2   Pass
x = 1; n=2; y_correct = 1; assert((nroot(n,x)-y_correct)<0.001)

ans = 1

3   Pass
x = 1; n=2; y_correct = 1; assert((nroot(n,x)-y_correct)<0.001)

ans = 1

4   Pass
x = 10; n=2; y_correct = 3.1623; assert((nroot(n,x)-y_correct)<0.001)

ans = 3.1623

5   Pass
x = 10; n=10; y_correct = 1.2589; assert((nroot(n,x)-y_correct)<0.001)

ans = 1.2589

6   Pass
x = 100; n=100; y_correct = 1.0471; assert((nroot(n,x)-y_correct)<0.001)

ans = 1.0471