Cody

# Problem 12. Fibonacci sequence

Solution 185983

Submitted on 4 Jan 2013 by Camille
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))

f = 1

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

f = 2 X = 1 Y = 2 f = 3 X = 2 Y = 3 f = 5 X = 3 Y = 5 f = 8 X = 5 Y = 8

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

f = 2 X = 1 Y = 2 f = 3 X = 2 Y = 3 f = 5 X = 3 Y = 5 f = 8 X = 5 Y = 8 f = 13 X = 8 Y = 13 f = 21 X = 13 Y = 21 f = 34 X = 21 Y = 34 f = 55 X = 34 Y = 55

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

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