Automatically find all roots of a function using bisect method

MATLAB using bisection:
Function: -x^4+12x^2-3x-5 Defined on [-4,4]
Write a script to automatically find the intervals [a,b] containing the four roots. Then, plot them.
I have already plotted the function, but am stuck on how to find the roots.

댓글 수: 1

Sam Chak
Sam Chak 2022년 4월 26일
편집: Sam Chak 2022년 4월 26일
@ILoveMath, Can you show the bisection formula in LaTeX and then write it in MATLAB code?
Mathematics is a declarative language that shows the Iteration formula, but generally does not teach "looping".
Does the Lecturer or the Textbook show another formula to automatically find all ROOTS using Bisection iteration formula?

댓글을 달려면 로그인하십시오.

답변 (1개)

Torsten
Torsten 2022년 4월 26일
편집: Torsten 2022년 4월 26일

0 개 추천

Choose delta small, e.g. 0.01.
Evaluate f at -4 and at -4+delta.
If f(-4)*f(-4+delta) <=0, there will be a root in between.
If f(-4)*f(-4+delta)>0, continue by setting -4 to -4+delta and -4+delta -> -4+2*delta.
If f(-4+delta)*f(-4+2*delta) <=0, there will be a root in between...

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

태그

질문:

2022년 4월 26일

편집:

2022년 4월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by