%% Fibonacci Sequence Approximates Golden Ratio
% The ratio of successive Fibonacci numbers converges to the golden ratio 1.61803.... Show this convergence by plotting this ratio against the golden ratio for the first 10 Fibonacci numbers.

n = 2:10;
ratio = fibonacci(n)./fibonacci(n-1);

plot(n,ratio,'--o')
hold on

line(xlim,[1.618 1.618])
hold off

% Copyright 2012 The MathWorks, Inc.