Question: Recursive Fibonacci Generator ( simple recursion ) The Fibonacci sequence is defined by F = 1 , 1 , 2 , 3 , 5 ,
Recursive Fibonacci Generator simple recursion
The Fibonacci sequence is defined by
dots
where the term is given by
Write a function named recursiveFibonacci that accepts a single scalar input, and uses recursion to compute the term of the sequence.
Use recursion to solve this problem and not the MATLAB fibonacci function. The tests will check that you did not use any for or while loop or fibonacci.
Note the function command is given in line with suggested names for the input and output variables. You can change the names but not the order of these variables if you like.
Do not change the name of the function, however, as this exact name is required for the tests to run. Be sure to assign a value to the output variable.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
