Question: 1) A Fibonacci sequence is composed of elements created by adding the two previous elements. The simplest Fibonacci sequence starts with 1, 1 and proceeds

 1) A Fibonacci sequence is composed of elements created by adding

1) A Fibonacci sequence is composed of elements created by adding the two previous elements. The simplest Fibonacci sequence starts with 1, 1 and proceeds as follows: 1, 1, 2, 3, 5, 8, 13, ... Fibonacci sequences appear regularly in nature. For example, the shell of the chambered nautilus grows in accordance with a Fibonacci sequence. Fig 1: Chambered nautilus. (Colin Keates Dorling Kindersley, Courtesy of the Natural History Museum, London.) Using the input command prompt the user to enter the total number of elements requested for the simplest Fibonacci sequence. Find the sequence and store it in an array by using a for loop. Display the Fibonacci sequence using fprintf command. Now plot your results on a polar graph. Use the element number for the angle and the value of the element in the sequence for the radius. 2) Repeat the preceding problem, this time using a while loop. 3) One interesting property of a Fibonacci sequence is that the ratio of the values of adjacent members of the sequence approaches a number called "the golden ratio" or phi. Create a program that calculates the values in the sequence until the ratio of adjacent values converges to within 0.001. You can do this in a while loop by comparing the ratio of element k to element k-1 and the ratio of element k-1 to element k-2. If you call your sequence seq, then the code for the while statement is while abs(seq(k)/seq(k-1) - seg(k-1)/seq(K-2))>0.001 Display the Fibonacci sequence using fprintf command. Display also the total number of elements in the sequence

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!