Cody

# Problem 12. Fibonacci sequence

Solution 1851514

Submitted on 18 Jun 2019 by Xinyu Xu
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 b = 2 f = 3 b = 3 f = 5 b = 5 f = 8 b = 8

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

f = 2 b = 2 f = 3 b = 3 f = 5 b = 5 f = 8 b = 8 f = 13 b = 13 f = 21 b = 21 f = 34 b = 34 f = 55 b = 55

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

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

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!