Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a script file that performs the following calculations Your script will use the functions you create Label all graphs appropriately. For this project, do
Create a script file that performs the following calculations Your script will use the functions you create Label all graphs appropriately. For this project, do not have your homemade functions print anything, instead have all your fprintf commands within your script. Attach your published script file along with.m files for your functions Exercise 1. A fundamental iterative method for finding the roots of equations of one-variable is known as Newton's Method. It works like so: Theorem (Newton's Method). Given a continuous differentiable function (a) and a starting point o sufficient close to a root off the sequence: SI-1) Ik = --TE will converge to the root. Create a matlab code x-newt (f.df,x0,n) that will use Newton's method to approximate a root of / given its derivative and a starting point to performing na iterations. The f and af will be inputted as anonymous matlab functions in should be a vector containing each (a) Use newton's method to find the only root of the function (1) =-+1. Compare your answer with that found using MATLAB's build it solver fzero. (b) Use newton's method to estimate the cube root of 99. Start with no = 99 and plot(", 1:20. ) for (c) Create a function (xn n)-newt2(f.df.x0.err) that will continue to use newton's method until the relative error = is less than err. Have your function output how many iterations it takes Run your function with the from part (a), err-.01 and 3 =1. How many iterations were required? Note: The functions above have you input the derivative off. Por extra credit, you can have the functions set and newt2 calculated on their own
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started