Problem 1997. Compute Fibonacci Number
Solution Stats
Problem Comments
-
1 Comment
This is the same as Problem 12.
Solution Comments
-
1 Comment
This is cool because there's also an explicit equation (Binet) for this!
-
1 Comment
This solution returns f(0) = 1, which contradicts the decription of the given problem.
-
3 Comments
This solution uses filter from the Signal Processing Toolbox.
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)
... 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
-
Find state names that end with the letter A
948 Solvers
-
Find common elements in matrix rows
1909 Solvers
-
359 Solvers
-
Getting the absolute index from a matrix
222 Solvers
-
Are all the three given point in the same line?
342 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!