
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Page 1 of 1
Put your work in a script file as previously.
Write a function called Babylonian that uses fixed-point iteration to find the square root of any positive number, to a given tolerance on the change in x. Then call it to find the square roots of 5, 7, and 8 with a tolerance of 0.0001. Double-check the answers you get by squaring them.
Use bisect.m from the website to find the square roots of the same numbers to a tolerance of 0.0001. Double-check your answers as above.
Write some Matlab code that determines the number of digits of accuracy to which 3. represents ฯ. I used the max and find functions to do this.
Use fixed-point iteration to solve the following system of equations. Iterate until the norm of the change in x, y, and z is less than 0.0001. Plug your results back into the equations as a sanity check. x 2 + 20x +y^2 + z 2 - 20 = 0 x^2 + 20y + z 2 - 20 = 0 x^2 + y 2 - 40z = 0
Use fminbnd() to find a minimum of (x โ 0.7)^2 on the interval [0,1].
Use fminsearch() to solve the following problem: given the points in the following figure, find p 5 and p 6 such that the sum of the 8 paths that link the points is minimal (there is no path from p 1 to p 2 along the x axis). p 1 =(0,0) p 2 =(1.8,0) p 3 =(1.5,1) p 4 =(0.3,1.6). Display both the locations of p 5 and p 6 and the total minimized distance. Note that the function argument to fminsearch can be a function handle or a string with the name of an external function (.mat file).
0.5 1.0 1.
p
p
p
p
p p
x
y