Cody

Solution 805584

Submitted on 13 Jan 2016 by Azhar
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 = 1; f = 1; assert(isequal(fib(n),f))

a = 1 b = 1 f = 1

2   Pass
%% n = 6; f = 8; assert(isequal(fib(n),f))

a = 1 b = 1 f1 = 2 a = 1 b = 2 f1 = 3 a = 2 b = 3 f1 = 5 a = 3 b = 5 f1 = 8 a = 5 b = 8 f = 8

3   Pass
%% n = 10; f = 55; assert(isequal(fib(n),f))

a = 1 b = 1 f1 = 2 a = 1 b = 2 f1 = 3 a = 2 b = 3 f1 = 5 a = 3 b = 5 f1 = 8 a = 5 b = 8 f1 = 13 a = 8 b = 13 f1 = 21 a = 13 b = 21 f1 = 34 a = 21 b = 34 f1 = 55 a = 34 b = 55 f = 55

4   Pass
%% n = 20; f = 6765; assert(isequal(fib(n),f))

a = 1 b = 1 f1 = 2 a = 1 b = 2 f1 = 3 a = 2 b = 3 f1 = 5 a = 3 b = 5 f1 = 8 a = 5 b = 8 f1 = 13 a = 8 b = 13 f1 = 21 a = 13 b = 21 f1 = 34 a = 21 b = 34 f1 = 55 a = 34 b = 55 f1 = 89 a = 55 b = 89 f1 = 144 a = 89 b = 144 f1 = 233 a = 144 b = 233 f1 = 377 a = 233 b = 377 f1 = 610 a = 377 b = 610 f1 = 987 a = 610 b = 987 f1 = 1597 a = 987 b = 1597 f1 = 2584 a = 1597 b = 2584 f1 = 4181 a = 2584 b = 4181 f1 = 6765 a = 4181 b = 6765 f = 6765