Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use Matlab for this problem. Also use for loops or while loops. The Fibonacci sequence is an integer sequence calculated by adding previous numbers

image text in transcribed

please use Matlab for this problem.

Also use for loops or while loops.

The Fibonacci sequence is an integer sequence calculated by adding previous numbers together to calculate the next value. This is represented mathematically by saying that Fn F1Fn2 (where Fn is the nth value in the sequence F). The Fibonacci sequence starts with the numbers 0 and 1. Fibonacci sequence: F. F5 F6 Fr (or User (or User Input) Input) Write a code that asks the user how many values they would like to calculate, then find the Fibonacci sequence to that many values. Display the sequence to the command window as a column by using a for loop. Bonus: The Fibonacci sequence is also closely related to the "Golden-ratio" (1.618.). You can approximate the golden-ratio by dividing any number in the Fibonacci sequence by the previous number, Gest Fr/F-1. The longer the Fibonacci sequence, the more accurate this approximation becomes Fs/F, # 1.5 F1o/F9 -1.619 Ask the user how many decimals of accuracy they would like to calculate the Golden ratio to. Then start a Fibonacci sequence and continue calculating until you have reached the desired accuracy. Once you have done so, output the number of values in your Fibonacci sequence and the approximate value of the golden ratio shown to the number of requested decimals (up to The exact value of the golden ratio can be calculated from Gexact-(1+ sqrt(5))/2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions