Problem 1997. Compute Fibonacci Number
Solution Stats
Problem Comments
-
1 Comment
Benjamin Richards
on 12 Feb 2020
This is the same as Problem 12.
Solution Comments
-
1 Comment
Philena
on 13 Jul 2022
This is cool because there's also an explicit equation (Binet) for this!
-
1 Comment
yurenchu
on 24 Dec 2016
This solution returns f(0) = 1, which contradicts the decription of the given problem.
-
3 Comments
Brian Butler
on 16 Nov 2015
This solution uses filter from the Signal Processing Toolbox.
Peng Liu
on 18 Nov 2015
Yes, it uses filter, but filter is indeed not a toolbox function, but a built-in function. You can fix the error by changing f=y(n-2) to f = y(n)
Jan Orwat
on 18 Nov 2015
... and then change first input of filter to [1,-1] and remove +1 from the end of the line.
-
2 Comments
Problem Recent Solvers393
Suggested Problems
-
33823 Solvers
-
Return the largest number that is adjacent to a zero
4464 Solvers
-
691 Solvers
-
267 Solvers
-
478 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!