Problem 1997. Compute Fibonacci Number

Solution 1608639

Submitted on 14 Aug 2018
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
assert(isequal(fibonacci(1),1)) assert(isequal(fibonacci(2),1)) assert(isequal(fibonacci(5),5)) assert(isequal(fibonacci(7),13)) assert(isequal(fibonacci(13),233)) assert(isequal(fibonacci(15),610))

Undefined function 'fib' for input arguments of type 'double'. Error in fibonacci (line 5) f = fib(n-2)+fib(n-1); Error in Test1 (line 2) assert(isequal(fibonacci(2),1))