rootSolve(func, xLow, xUpp, tol)

This function uses Ridder's Method to do non-linear root finding
Updated 24 Apr 2017

View License

This function uses Ridder's Method to do non-linear root finding. This method works well for smooth scalar functions, and requires a bounded search space.
% FUNCTION: This function uses Ridder's Method to return a root, xZero,
% of func on the interval [xLow,xUpp]
% func = a function for a SISO function: y = f(x)
% xLow = the lower search bound
% xUpp = the upper search bound
% tol = return xZero if abs(func(xZero)) < tol
% xZero = the root of the function on the domain [xLow, xUpp]
% 1) The function must be smooth
% 2) sign(f(xLow)) ~= sign(f(xUpp))
% 3) This function will return a root if one exists, and the function is
% not crazy. If there are multiple roots, it will return the first one
% that it finds.

Cite As

Matthew Kelly (2024). rootSolve(func, xLow, xUpp, tol) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Physics 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!
Version Published Release Notes

updated documentation

Added feature: the user can now specify the convergence tolerance.

Fixed a small bug: the tolerance for checking roots on the boundary of the interval was set to 0, rather than the convergence tolerance.

Added photo.