Question: Exercise 1 Write a function chord method.m implementing the chord method to find the zeros of a nonn ear equation. The function should be of

Exercise 1 Write a function chord method.m implementing the chord method to find the zeros of a nonn ear equation. The function should be of the following form function [20 , iter , res ,his] chord method(fun , a , b ,tol,Nmax) = Inputs: fun: function handle representing f() a, b: interval a, bn which we believe there is a zero tol: maximum tolerance allowed for the increment l1(k+1)-1(k) Nmax: maximum number of iterations allowed Outputs: zo: approximation of the zero it (k)| res: residual at z0 (i.e., If(zo)D) his: vector collecting all elements of the sequence rk-. (convergence history) er: number of iterations to achieve tolerance tol on the increment 1r0+1)-r The function should return the numerical approximation of the zero when the increment at iteration k +1 is such that 11(k+1)-r(
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
