Secant Method - A Computational Example

A Computational Example

The Secant method is applied to find a root of the function f(x)=x2−612. Here is an implementation in the Matlab language. (From calculation, we expect that the iteration converges at x=24.7386)

f=@(x)x^2-612; x(1)=10; x(2)=30; for i=3:7 x(i) = x(i-1) - (f(x(i-1)))*((x(i-1) - x(i-2))/(f(x(i-1)) - f(x(i-2)))); end root=x(7)

Read more about this topic:  Secant Method