0% found this document useful (0 votes)
27 views1 page

Bisection Method: Input Program & Result

The document describes using the bisection method to find the root of a function. It provides the input values, shows the program and result. The program iteratively calculates the midpoint between bounds and narrows in on the root until the accuracy threshold is met, finding the root to be 0.621094.

Uploaded by

YASH DOSHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

Bisection Method: Input Program & Result

The document describes using the bisection method to find the root of a function. It provides the input values, shows the program and result. The program iteratively calculates the midpoint between bounds and narrows in on the root until the accuracy threshold is met, finding the root to be 0.621094.

Uploaded by

YASH DOSHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

BISECTION METHOD

Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1

Name of the Student:Shubham Chapparghare Roll No:351013

INPUT
SC_BSM(@(x)cos(x)-1.3*x,0,1,0.01)

PROGRAM & RESULT


function[]=SC_BSM(fun,x1,x2,acc)
y1=feval(fun,x1);
y2=feval(fun,x2);
while y1*y2>0
x1=input('Enter new value of x1:');
x2=input('Enter new value of x2:');
y1=feval(fun,x1);
y2=feval(fun,x2);
end
while abs(x2-x1)>acc
x0=(x1+x2)/2;
y0=feval(fun,x0);
if y1*y0<0
x2=x0;
y2=y0;
else x1=x0;
y1=y0;
end
end
x0=(x1+x2)/2;
fprintf('The root of given function is %f\n',x0);

The root of given function is 0.621094

Published with MATLAB® R2017a

You might also like