Question

The Golden Ratio is an irrational number whose existence has been known and whose properties have been studied for many centuSUBJECI | 00 Sheci Table 1: Golden Ratio Approximation N error phi exact 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOURCE CODE IN MATLAB:

%setting initial values
exact=1.618033988749894848;
N=0;
phi=1.0;
fprintf("____________________________________________\n"); %output header
fprintf(" N phi exact\n"); %output header
fprintf("____________________________________________\n"); %output header
fprintf("%4d%20.16f%20.16f\n", N, phi, exact); %output
for N=1:25
phi=sqrt(1+phi); %estimating new phi
fprintf("%4d%20.16f%20.16f\n", N, phi, exact); %output
end

OUTPUT:

octave: 8> source(HW7P3.m) N phi exact 0 1.0000000000000000 1.6180339887498949 1 1.4142135623730951 1.6180339887498949 2 1.

Regards!

Add a comment
Know the answer?
Add Answer to:
The Golden Ratio is an irrational number whose existence has been known and whose properties have...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Done in matlab In mathematics, two quantities are in the golden ratio if their ratio is...

    Done in matlab In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. a + b a for a b>0 Mathematicians since Euclid have studied the properties of the golden ratio, including its appearance in the dimensions of a regular pentagon and in a golden rectangle, which may be cut into a square and a smaller rectangle with the same aspect ratio....

  • 13.21 Lab: Rational class This question has been asked here before, but every answer I have...

    13.21 Lab: Rational class This question has been asked here before, but every answer I have tested did not work, and I don't understand why, so I'm not able to understand how to do it correctly. I need to build the Rational.cpp file that will work with the main.cpp and Rational.h files as they are written. Rational Numbers It may come as a bit of a surprise when the C++ floating-point types (float, double), fail to capture a particular value...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT