Question: Write a MATLAB function, called bisection_method that inputs a function f, two numbers a, b, an error tolerance, tol, and a maximum number of iterations,

 Write a MATLAB function, called bisection_method that inputs a function f,

Write a MATLAB function, called bisection_method that inputs a function f, two numbers a, b, an error tolerance, tol, and a maximum number of iterations, N, and finds a root c of f in the interval [a, b] using the bisection method. Your function should compute a bound on the error, and stop when the error is less than the tolerance, or if the number of iterations exceeds N - whichever happens first. (a) Hint #1 The function should start with the line function [c, n, err] = bisection_method(f, a, b, tol, N) (b) Hint #2: The function should contain a 'while' loop, looking something like: while err > tol && n

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!