Cody

Solution 1878230

Submitted on 18 Jul 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   Pass
n = 6; out = 8; assert(isequal(next_fibonacci(n),out));

y = uint64 8

2   Fail
n = [12 40 50]; out = [13 55 55]; assert(isequal(next_fibonacci(n),out));

Error using <= Matrix dimensions must agree. Error in next_fibonacci (line 12) y= t(numel(t(t<=x))+1) Error in Test2 (line 3) assert(isequal(next_fibonacci(n),out));

3   Fail
n = 10.^(1:5); out = [13 144 1597 10946 121393]; assert(isequal(next_fibonacci(n),out));

Error using <= Matrix dimensions must agree. Error in next_fibonacci (line 12) y= t(numel(t(t<=x))+1) Error in Test3 (line 3) assert(isequal(next_fibonacci(n),out));

4   Fail
n = round(7.^(3:.5:7)); out = [377 987 2584 6765 17711 46368 121393 317811 832040]; assert(isequal(next_fibonacci(n),out));

Error using <= Matrix dimensions must agree. Error in next_fibonacci (line 12) y= t(numel(t(t<=x))+1) Error in Test4 (line 3) assert(isequal(next_fibonacci(n),out));

Suggested Problems

More from this Author2