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

3 visualizaciones (últimos 30 días)
Behbod Izadi
Behbod Izadi el 30 de Oct. de 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

Respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by