This problem is a code for MATLAB.
For the problems below, you may assume that all (numeric) function input arguments are scalars.
Problem 1: (33%) Write a function with the header function [R, E] = myBisection(f, a, b, tol) which takes as input f: a function handle a: the initial left bracket around a root b: the initial right bracket around a 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 (xNew). E: a vector containing the error (the absolute value of f(xNew)). Tips: Be sure to include an iteration counter which will stop the while-loop if the number of iterations gets greater than 100. It is not necessary to print out a convergence table within the while loop. (I.e., there should be no fprintf statements in your code)