Question: 3. (20 points) Write a pseudocode of the Newton algorithm for computing the root of a real valued function. 4. (20 points) Implement your code
3. (20 points) Write a pseudocode of the Newton algorithm for computing the root of a real valued function. 4. (20 points) Implement your code as a Matlab function using the following inputs and outputs Input f(x)-The real valued function for which you want to find the root. f(x) -The derivative of f(x). .o -An initial guess of the root .tol -A tolerance maziter-A maximum number of iterations. Output r-The root of your function resarray- An array of the residuals at each step. The first line of your code should therefore read: function [r, resarray] newton (f,df , x0 , tol,maxiter)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
