Cody

# Problem 42340. Fibonacci Decomposition

Solution 3626153

Submitted on 11 Nov 2020
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 = 1; f_correct = 1; assert(isequal(fib_decomposition(n),f_correct))

Unrecognized function or variable 'fib_cur'. Error in fib_decomposition (line 12) n = n - fib_cur; Error in Test1 (line 3) assert(isequal(fib_decomposition(n),f_correct))

2   Fail
n = 4; f_correct = [1 3]; assert(isequal(fib_decomposition(n),f_correct))

Unrecognized function or variable 'fib_cur'. Error in fib_decomposition (line 12) n = n - fib_cur; Error in Test2 (line 3) assert(isequal(fib_decomposition(n),f_correct))

3   Fail
n = 6; f_correct = [1 5]; assert(isequal(fib_decomposition(n),f_correct))

Unrecognized function or variable 'fib_cur'. Error in fib_decomposition (line 12) n = n - fib_cur; Error in Test3 (line 3) assert(isequal(fib_decomposition(n),f_correct))

4   Fail
n = 2010; f_correct = [2 34 377 1597]; assert(isequal(fib_decomposition(n),f_correct))

Unrecognized function or variable 'fib_cur'. Error in fib_decomposition (line 12) n = n - fib_cur; Error in Test4 (line 3) assert(isequal(fib_decomposition(n),f_correct))

5   Fail
n = 35601; f_correct = [1 34 144 6765 28657]; assert(isequal(fib_decomposition(n),f_correct))

Unrecognized function or variable 'fib_cur'. Error in fib_decomposition (line 12) n = n - fib_cur; Error in Test5 (line 3) assert(isequal(fib_decomposition(n),f_correct))

6   Fail
n = 9227467; f_correct = [2 9227465]; assert(isequal(fib_decomposition(n),f_correct))

Unrecognized function or variable 'fib_cur'. Error in fib_decomposition (line 12) n = n - fib_cur; Error in Test6 (line 3) assert(isequal(fib_decomposition(n),f_correct))

7   Fail
n = 2015; f_correct = [2 5 34 377 1597]; assert(isequal(fib_decomposition(n),f_correct))

Unrecognized function or variable 'fib_cur'. Error in fib_decomposition (line 12) n = n - fib_cur; Error in Test7 (line 3) assert(isequal(fib_decomposition(n),f_correct))

### Community Treasure Hunt

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

Start Hunting!