Cody

# Problem 44659. Nth root of a number

Solution 1987845

Submitted on 23 Oct 2019
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   Fail
a = 1; N = 100 y_correct = 1; assert(isequal(rootN(a,N),y_correct))

N = 100

Unrecognized function or variable 'x'. Error in rootN (line 2) y = x.^N Error in Test1 (line 4) assert(isequal(rootN(a,N),y_correct))

2   Fail
a = [1 64 216]; N = 3 y_correct = [1 4 6]; assert(isequal(rootN(a,N),y_correct))

N = 3

Unrecognized function or variable 'x'. Error in rootN (line 2) y = x.^N Error in Test2 (line 4) assert(isequal(rootN(a,N),y_correct))

3   Fail
a = 1/100; N = 2 y_correct = 1/10; assert(isequal(rootN(a,N),y_correct))

N = 2

Unrecognized function or variable 'x'. Error in rootN (line 2) y = x.^N Error in Test3 (line 4) assert(isequal(rootN(a,N),y_correct))

4   Fail
a = 826^10; N = 10 y_correct = 826; assert(isequal(rootN(a,N),y_correct))

N = 10

Unrecognized function or variable 'x'. Error in rootN (line 2) y = x.^N Error in Test4 (line 4) assert(isequal(rootN(a,N),y_correct))