Cody

Solution 1944845

Submitted on 21 Sep 2019 at 10:37
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
n = 6; out = 8; assert(isequal(next_fibonacci(n),out));

y = 5.0000 y = 5.0000 8.0000

Assertion failed.

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

y = 8.0000 y = 8.0000 13.0000 y = 8.0000 13.0000 34.0000 y = 8.0000 13.0000 34.0000 55.0000 y = 8.0000 13.0000 34.0000 55.0000 34.0000 y = 8.0000 13.0000 34.0000 55.0000 34.0000 55.0000

Assertion failed.

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

y = 8.0000 y = 8.0000 13.0000 y = 8.0000 13.0000 89.0000 y = 8.0000 13.0000 89.0000 144.0000 y = 8.0000 13.0000 89.0000 144.0000 987.0000 y = 1.0e+03 * 0.0080 0.0130 0.0890 0.1440 0.9870 1.5970 y = 1.0e+03 * 0.0080 0.0130 0.0890 0.1440 0.9870 1.5970 6.7650 y = 1.0e+04 * 0.0008 0.0013 0.0089 0.0144 0.0987 0.1597 0.6765 1.0946 y = 1.0e+04 * 0.0008 0.0013 0.0089 0.0144 0.0987 0.1597 0.6765 1.0946 7.5025 y = 1.0e+05 * 0.0001 0.0001 0.0009 0.0014 0.0099 0.0160 0.0677 0.1095 0.7503 1.2139

Assertion failed.

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

y = 233.0000 y = 233.0000 377.0000 y = 233.0000 377.0000 610.0000 y = 233.0000 377.0000 610.0000 987.0000 y = 1.0e+03 * 0.2330 0.3770 0.6100 0.9870 1.5970 y = 1.0e+03 * 0.2330 0.3770 0.6100 0.9870 1.5970 2.5840 y = 1.0e+03 * 0.2330 0.3770 0.6100 0.9870 1.5970 2.5840 4.1810 y = 1.0e+03 * 0.2330 0.3770 0.6100 0.9870 1.5970 2.5840 4.1810 6.7650 y = 1.0e+04 * 0.0233 0.0377 0.0610 0.0987 0.1597 0.2584 0.4181 0.6765 1.0946 y = 1.0e+04 * 0.0233 0.0377 0.0610 0.0987 0.1597 0.2584 0.4181 0.6765 1.0946 1.7711 y = 1.0e+04 * 0.0233 0.0377 0.0610 0.0987 0.1597 0.2584 0.4181 0.6765 1.0946 1.7711 2.8657 y = 1.0e+04 * 0.0233 0.0377 0.0610 0.0987 0.1597 0.2584 0.4181 0.6765 1.0946 1.7711 2.8657 4.6368 y = 1.0e+04 * 0.0233 0.0377 0.0610 0.0987 0.1597 0.2584 0.4181 0.6765 1.0946 1.7711 2.8657 4.6368 7.5025 y = 1.0e+05 * 0.0023 0.0038 0.0061 0.0099 0.0160 0.0258 0.0418 0.0677 0.1095 0.1771 0.2866 0.4637 0.7503 1.2139 y = 1.0e+05 * 0.0023 0.0038 0.0061 0.0099 0.0160 0.0258 0.0418 0.0677 0.1095 0.1771 0.2866 0.4637 0.7503 1.2139 1.9642 y = 1.0e+05 * 0.0023 0.0038 0.0061 0.0099 0.0160 0.0258 0.0418 0.0677 0.1095 0.1771 0.2866 0.4637 0.7503 1.2139 1.9642 3.1781 y = 1.0e+05 * 0.0023 0.0038 0.0061 0.0099 0.0160 0.0258 0.0418 0.0677 0.1095 0.1771 0.2866 0.4637 0.7503 1.2139 1.9642 3.1781 5.1423 y = 1.0e+05 * 0.0023 0.0038 0.0061 0.0099 0.0160 0.0258 0.0418 0.0677 0.1095 0.1771 0.2866 0.4637 0.7503 1.2139 1.9642 3.1781 5.1423 8.3204

Assertion failed.