Problem 12. Fibonacci sequence
Solution Stats
Problem Comments
-
21 Comments
@Brendan It's most likely an attempt to make look-up solutions that merely encode the return values for all the tests (and which are widely considered cheating) that little bit harder. I do agree that this is questionable insofar as that banning elseif in particular also messes with genuine solutions.
Good one
@Christian you still can do it without if/else chains. Just create a lookup table of fibonacci answers and then pull n+1 from the sequence. No if/else required
Solution Comments
Show commentsProblem Recent Solvers13568
Suggested Problems
-
Determine whether a vector is monotonically increasing
21301 Solvers
-
3709 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1885 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
763 Solvers
-
568 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!