Question: Using MATlab Fibonacci Numbers My Solutions > The Fibonacci sequence, which is strongly related to the golden ratio, is defined as: Fo=0, F1 = 1,

Using MATlab
Fibonacci Numbers My Solutions > The Fibonacci sequence, which is strongly related to the golden ratio, is defined as: Fo=0, F1 = 1, and Fo=Fn-1+Fn-2 for cases where n>1. Greater than one? Yes, the cases of n=0 and n=1 are defined for us above. The first few numbers in this sequence are provided here, just for context: 0,1,1,2,3,5,8,13,21, 34,... Using a for loop, calculate the first 25 numbers in the Fibonacci sequence. Next, calculate the ratio between each of the numbers in the sequence. The ratio can be defined as: R- As a hint for each of these challenges, ask yourself, do you start with 1 and go to 25? Or is it maybe something else that you need to start at, or end at? Finally, plot both the sequence and the ratio against the iteration number. Meaning, the 20th term (x) against the 20th Fibonacci number (y). And the 21st term (x) against the 20th ratio (y) (you aren't being tested on this plot this time, but it's good to figure this out for when you will be assessed on it) Looking at your plot, where does it look like the ratio has stabilized? Where does the ratio stop changing much? Curous to learn more? Check out the Wikipedia entry here: https://en.wikipedia.org/wiki/Fibonacci_number Script Save C Reset DE MATLAB Documentation 1 F(1) = 0 2 F(2) = 1 3 for n = % what n should you go from and to? F(n) = % calculate this Fun % you know what goes here ... % Now write a for loop for calculating the ratio, R 8 9 F % print the values of F 10 R % print the values of R (this is a strong hint you need a row vector called R for the assessment) 11 12 figure % create a new figure 13 x_n = % us your matrix skills to create a vector that reflects what we want to use for the x when we plot F 14 plot(x_n, % we need to fill in the rest here... 15 % repeat the above few lines, but for plotting R
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
