Borrar filtros
Borrar filtros

Automatically find all roots of a function using bisect method

3 visualizaciones (últimos 30 días)
ILoveMath
ILoveMath el 26 de Abr. de 2022
Editada: Sam Chak el 26 de Abr. de 2022
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 comentario
Sam Chak
Sam Chak el 26 de Abr. de 2022
Editada: Sam Chak el 26 de Abr. de 2022
@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?

Iniciar sesión para comentar.

Respuestas (1)

Torsten
Torsten el 26 de Abr. de 2022
Editada: Torsten el 26 de Abr. de 2022
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...

Categorías

Más información sobre Graphics Objects en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by