Root of a function

4 vues (au cours des 30 derniers jours)
Carlos Tavares
Carlos Tavares le 7 Jan 2018
Modifié(e) : Matt J le 7 Jan 2018
Hello, I'm new in the Matlab world, so i need some help.
I need to Determine the roots of a function of a variable function (the function is required by the algorithm and inserted by the user the user). The user inserts two initial points, one of which the function is positive, in the other is negative.
Thank you

Réponses (1)

Matt J
Matt J le 7 Jan 2018
Modifié(e) : Matt J le 7 Jan 2018
Use the fzero() command. E.g.,
>> [xroot,fval]=fzero(@cos,[pi/4, 3*pi/4])
xroot =
1.5708 %pi/2
fval =
6.1232e-17

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by