image thumbnail

Bisection Method (bisection_method)

version 5.0.0 (334 KB) by Tamas Kis
Calculates the root of a univariate function using the bisection method.

72 Downloads

Updated 29 Aug 2021

From GitHub

View license on GitHub

bisection_method View Bisection Method (bisection_method) on File Exchange

Calculates the root of a univariate function using the bisection method.

Syntax

root = bisection_method(f,a,b)
root = bisection_method(f,a,b,opts)

Description

root = bisection_method(f,a,b) returns the root of a function specified by the function handle f, where a and b define the initial guess for the interval containing the root. The default tolerance and maximum number of iterations are TOL = 1e-12 and imax = 1e6, respectively.

root = bisection_method(f,a,b,opts) does the same as the syntax above, but allows for the specification of optional solver parameters. opts is a struct that has the following fields:

  • imax → maximum number of iterations
  • return_all → all intermediate root estimates are returned if set to true; otherwise, only the converged root is returned
  • TOL → tolerance
  • warningstrue if any warnings should be displayed, false if not

Examples and Additional Documentation

  • See "EXAMPLES.mlx" or the "Examples" tab on the File Exchange page for examples.
  • See "Bisection_Method.pdf" (also included with download) for the technical documentation.

Cite As

Tamas Kis (2021). Bisection Method (bisection_method) (https://github.com/tamaskis/bisection_method-MATLAB/releases/tag/v5.0.0), GitHub. Retrieved .

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

Community Treasure Hunt

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

Start Hunting!
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.