Question: plz add comments so I can understand the code Write a MATLAB function, called Newtons_method that inputs a function, f, it's derivative f', an initial

 plz add comments so I can understand the code Write a

plz add comments so I can understand the code

Write a MATLAB function, called Newtons_method that inputs a function, f, it's derivative f', an initial guess o, an error tolerance, tol, and a maximum number of iterations, N, and outputs the root of f obtained using Newton's method (denoted by c), starting with ro. Your function should have an error defined by err= Irn-in-1, and stop when the error is less than the tolerance, or if the number of iterations exceeds N - whichever happens first. Your function header should look something like: function [c,n,err] Newtons-method (f,fp , x0,tol,N) = where n is the last iteration when you stop. to an accuracy of less than = 10-8. Did your method converge, and if so, how many iterations did it take? If not, why didn't it converge, and what happened-did it diverge, or end up in an infinite loop? Plot on the same graph the function and the axis y-0. Test with x,--2. What is happening

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!