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

3 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by