Bisection Method Root Finding

Very simple to use and robust method that takes array inputs, so it even has advantages over fzero.
Updated 15 Jan 2023

BISECTION is a fast, simple-to-use, and robust root-finding method that handles n-dimensional arrays.

Additional optional inputs and outputs for more control and capabilities that don't exist in other implementations of the bisection method or other root finding functions like fzero.
This function really shines in cases where fzero would have to be implemented in a loop to solve multiple cases, in which case this will be much faster.

It can find zero or non-zero roots.

This code can be a bit cryptic. This is for the sake of speed and increased capability. See the many acknowledged other submissions for simpler, easier-to-follow implementations to understand the basics of the bisection method.

Cite As

Sky Sartorius (2024). Bisection Method Root Finding (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Robust Control Toolbox in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

Linked to GitHub.


Initialization of variables in parent function to avoid warnings in newer versions of Matlab.


Small changes to help.

minor speed and formatting improvements

New tagline

Practically all new code and documentation with added features. A good deal of testing done, but with so much new code, please let me know if you find errors.

fixed bug that sometimes caused premature convergence; redid funcntion halding to get rid of one of the input checks and simplify the code and make it more understandable; changed some of the help documentation

fixed a bug that was very rarely throwing out some valid results

made it possible to handle a function that returns array results for scalar input; changed help a bit and added an example for new awesome feature

better example, fixed some help typos, tested in 2012b

Vectorized; fixed bug for decreasing functions; some check


To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.