Using Matlab
The Fibonacci sequence defined by
where the Nth term, is given by
As N increases, the ratio of two adjacent terms in the sequence approaches The Golden Ratio, ϕ:
Write a function that accepts a single input that is the tolerance, TolGR for the Golden Ratio calculation. Use a loop to generate Fibonacci numbers until the error in subsequent calculations of ϕ, defined by
is less than or equal to TolGR. Your function should output three scalar values, in order:
The final value of the Golden Ratio (a double precision number)
The largest Fibonacci number generated (32-bit unsigned integer datatype)
The number of terms, N, required to meet the tolerance (8-bit unsigned integer datatype).
Show transcribed image text