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

조회 수: 4 (최근 30일)
Behbod Izadi
Behbod Izadi 2019년 10월 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