File Exchange

## Bisection Method

version 1.0.0.0 (1.23 KB) by Brato CHAKRABARTI

### Brato CHAKRABARTI (view profile)

A very simple piece of code to solve a equation. But may come handy at times.

Updated 12 Nov 2011

The equation is of form, f(x) = 0. Provide the function, 'f' and provide two guesses. If the guesses are not according to bisection rule a message will be displayed on the screen.

Please rate it if you find useful

### Cite As

Brato CHAKRABARTI (2020). Bisection Method (https://www.mathworks.com/matlabcentral/fileexchange/33748-bisection-method), MATLAB Central File Exchange. Retrieved .

Jenny Khan

Just okey

Danylo Geidiuk

Kameka Claffey

xinyu fan

Daniela Bino

Gyan Swarup Nag

Erik Hoberg

### Erik Hoberg (view profile)

Hanan Ronaldo Quispe Condori

Faisal Alessa

muazam ali

shivam gaur

RJ Lluisma

### RJ Lluisma (view profile)

Yogesh Shamsunder Kumbargeri

### Yogesh Shamsunder Kumbargeri (view profile)

Thank you very much Brato! Its very useful code. Saves a lot of time : )

Justin: The way to use this code is as follows (the way I used it)
lets say we are required to find the value of x in equation x2 -2x =2
Lets say our initilal extreme guesses are 0 and 4

eqn= @(x) (x^2)-2*x-2;

I hope it helps!

Romina Mir

Nuria Ortiz

### Nuria Ortiz (view profile)

Jose Franco Abay-abay

Michael Kusaba

Justin Covington

### Justin Covington (view profile)

For example, if my function is x^2, where do I define x?

Justin Covington

### Justin Covington (view profile)

Where do I enter the limits and the function?

Yash

### Yash (view profile)

very useful

##### MATLAB Release Compatibility
Created with R2010a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux