Question: 1. Write a function bisectionmethod that inputs a function f, two numbers a and b, an error tolerance tol, and a maximum number of iterations

 1. Write a function bisectionmethod that inputs a function f, two

1. Write a function bisectionmethod that inputs a function f, two numbers a and b, an error tolerance tol, and a maximum number of iterations N, and approximates a root c of f in [a, b using the bisection method. Your function should compute a bound err on the absolute error and halt when err N, whichever happens first. The function signature should be as follows: function [e, n, err] * bisection sethod(f, a, b, tol, N) U se your code to solve fir)- 0, f:(2x3 + 31-1)cosz-z, fr zel-1,11, with tol = 10-5 (a) What number n of iterations were needed? (b) What is the error bound upon termination? (c) What is the expected rate of convergence? (d) Plot the function f and the r-axis (y 0) on the same graph. (e) Solve f(x) 0 on the same interval using MATLAB's rootfinder fzero, and compare with your solution

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!