Find real roots (or zeros) of a continuous function

版本 1.0.0 (3.0 KB) 作者: Lawrence Agbezuge
This program finds the real roots (or zeros) of a continuous function.
35.0 次下载
更新时间 2020/1/10

查看许可证

This program finds the real roots (or zeros) of continuous functions.
This is useful for finding the roots of polynomials, or of transcendental equations.
When too many roots are found in a specified domain, the domain may be shrunk so that the roots are found in a piecemeal fashion.
There should not be extraneous roots, but should they occur, they may be identified from the plot of the function.

Example 1:
f(x) = sin(x*cos(x)), in the domain x = [-20 20].
The domain is specified as -20:20.
Because 93 roots are found, in a piecemeal fashion, use these domains: -20:-15; -15:-10; -10:0; 0:10; 10:15; and 15:20.

Example 2:
f(x) = sin(x)/x (the sinc function), in the domain -20:20.
All roots in the specified domain are displayed.

Example 3:
f(x) = besselj(1,x) (the Bessel function of the first kind, order 1), in the domain -40:40.
All roots in the specified domain are displayed.

Example 4:
f(x) = x^5 – x^4 – 3*x^3 + 7*x^2 – 2*x – 5 in the domain -2.5:2.
All 3 real roots are displayed.
According to Descartes’ rule of signs, we should have 3 or 1 positive roots, and 2 or 0 negative roots.

引用格式

Lawrence Agbezuge (2024). Find real roots (or zeros) of a continuous function (https://www.mathworks.com/matlabcentral/fileexchange/73880-find-real-roots-or-zeros-of-a-continuous-function), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2019b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Bessel functions 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0