Question: Create a function to determine the left-most root of the following equation using the Bisection Method: f(x)=x2+10 The input would be in the sequence, a,
Create a function to determine the left-most root of the following equation using the Bisection Method:
f(x)=x2+10
The input would be in the sequence, a, b, and error. Name the function "bisection_method(a, b, error)". The "a" is the lower bound, the "b" is the upper bound, and the "error" is the tolerance level. If there is no root then the display would be "no root".
Note: Do not call the function at the end of the script. The function should only output one value; suppress all other outputs.
The code should have this:
Test
a = 0;
b = 5;
error = 0.01;
disp(bisection_method(a,b,error))
expected answer = 3.1543
test
a = -5;
b = 0;
error = 0.01;
disp(bisection_method(a,b,error))
expected answer = -3.1543
test
a = 0;
b = 5;
error = 0.0001;
disp(bisection_method(a,b,error))
expected answer = 3.16231
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
