Cody

Solution 827928

Submitted on 15 Feb 2016 by nag
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))

temp1 = 0 temp2 = 1 f = 1

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

temp1 = 0 temp2 = 1 f = 1 temp1 = 1 temp2 = 1 f = 2 temp1 = 1 temp2 = 2 f = 3 temp1 = 2 temp2 = 3 f = 5 temp1 = 3 temp2 = 5 f = 8

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

temp1 = 0 temp2 = 1 f = 1 temp1 = 1 temp2 = 1 f = 2 temp1 = 1 temp2 = 2 f = 3 temp1 = 2 temp2 = 3 f = 5 temp1 = 3 temp2 = 5 f = 8 temp1 = 5 temp2 = 8 f = 13 temp1 = 8 temp2 = 13 f = 21 temp1 = 13 temp2 = 21 f = 34 temp1 = 21 temp2 = 34 f = 55

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

temp1 = 0 temp2 = 1 f = 1 temp1 = 1 temp2 = 1 f = 2 temp1 = 1 temp2 = 2 f = 3 temp1 = 2 temp2 = 3 f = 5 temp1 = 3 temp2 = 5 f = 8 temp1 = 5 temp2 = 8 f = 13 temp1 = 8 temp2 = 13 f = 21 temp1 = 13 temp2 = 21 f = 34 temp1 = 21 temp2 = 34 f = 55 temp1 = 34 temp2 = 55 f = 89 temp1 = 55 temp2 = 89 f = 144 temp1 = 89 temp2 = 144 f = 233 temp1 = 144 temp2 = 233 f = 377 temp1 = 233 temp2 = 377 f = 610 temp1 = 377 temp2 = 610 f = 987 temp1 = 610 temp2 = 987 f = 1597 temp1 = 987 temp2 = 1597 f = 2584 temp1 = 1597 temp2 = 2584 f = 4181 temp1 = 2584 temp2 = 4181 f = 6765