This is the same as Problem 12.
This solution returns f(0) = 1, which contradicts the decription of the given problem.
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.
Test suite is flawed. I had to add a round(x,0) function to the output to make it pass.
Test is correct. Fibonacci Numbers are integers, so your output should be to.
Determine if input is odd
Sum of first n terms of a harmonic progression
07 - Common functions and indexing 4
Create a Matrix of Zeros
Divisible by 5
[Thermodynamics] Polynomial fitting of heat capacity data
[Thermodynamics] Estimate boiling point of n-alkanes
Volume of a truncated cube
Numerical differentiation with high precision
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office