How to use newton.m to find solutions to equations.

4 vues (au cours des 30 derniers jours)
Behbod Izadi
Behbod Izadi le 30 Oct 2019
Hi. I've got a question that asks me to use the 'newton.m' function which I've downloaded and opened onto matlab, to solve 'x + 1 = atan(x)'. I am not sure how to use the newton.m program, and have not been able to find the method of using it online.
This is what I've got so far but i keep getting errors and am not sure where to go from here:
>> syms x
x_estimate = newton(x + 1 - atan(x), 1 - 1/(x^2 + 1), -1, 10^(-7))
Iteration xo x1 f(x)
========= =======================================================
Array indices must be positive integers or logical values.
Error in sym/subsref (line 890)
R_tilde = builtin('subsref',L_tilde,Idx);
Error in newton (line 14)
while ((abs(f(x0)) >= epsilon) && (Iter<30))
I'd really appreciate if anyone can help me with this.
Thanks a lot

Réponses (0)

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