Code for matlab Write a function with the header function R

Code for matlab

Write a function with the header: function [R, E] = myNewton(f, fp, x_0, tol) which takes as input f: a function handle fp: a function handle to the derivative of the function f x_0: the initial guess of the root tol: a tolerance above which the algorithm will keep iterating. The function should return two vectors: R: a vector containing each guess of the root, x_i. E: a vector containing the error (the absolute value of f(x_0)

Solution

function handle is takes as input as function should retrun two vectors a vector contaning each guess of root xi and a vector containing the error now we now that it is necesary to print out a conergence table within the while loop and an iteration counter which will stop the while loop if the number of iterations get greater then 100 so we take as input a function handle

Code for matlab Write a function with the header: function [R, E] = myNewton(f, fp, x_0, tol) which takes as input f: a function handle fp: a function handle to

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site