
Then, the approximate guess values and desired tolerance of error are entered to the program, following the MATLAB syntax. In this program for secant method in Matlab, first the equation to be solved is defined and assigned with a variable ‘a’ using inline( ) library function. N=input('Enter allowed Error in calculation: ') X(2)=input('Enter second point of guess interval: ') X(1)=input('Enter first point of guess interval: ') Secant Method in MATLAB: % Secant Method in MATLAB

If x be the root of the given equation, it must satisfy: f(x) = 0 or y= 0. The equation of this secant line is given by: For that, it uses succession of roots of secant line in the curve.Īssume x 0 and x 1 to be the initial guess values, and construct a secant line to the curve through (x 0, f(x 0)) and (x 1, f(x 1)). root of the equation that represents the curve) as exactly as possible.

Secant method estimates the point of intersection of the curve and the X- axis (i.e. Mathematical Derivation of Secant Method:Ĭonsider a curve f(x) = 0 as shown in the figure below:

Here, we’ll go through a program for Secant method in MATLAB along with its mathematical background and a numerical example. Previously, we talked about secant method vis-à-vis C program and algorithm/flowchart for the method.
Secant method freemat free#
But, being free from derivative, it is generally used as an alternative to the latter method. During the course of iteration, this method assumes the function to be approximately linear in the region of interest.Īlthough secant method was developed independently, it is often considered to be a finite difference approximation of Newton’s method. Secant method is an iterative tool of mathematics and numerical methods to find the approximate root of polynomial equations.
