help me in trying to solve the secant method
4 views (last 30 days)
Hello all I try to write the code for secant method below:
x(i) = x(i-1) - (f(x(i-1)))*((x(i-1) - x(i-2))/(f(x(i-1)) - f(x(i-2))));
if abs((x(i)-x(i-1))/(x(i)))*100 < err %in this line
When i try to run the code it says that error index exceeds the maximum array elements(3) in the line no specified with green comment. How to solve the problem? Is there any way so that I can run the program from here?