You are on page 1of 1

SUCCESSIVE

APPROXIMATION METHOD
Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1

Name of the Student: Shubham Chapparghare Roll No:351013

INPUT
SC_SAM(@(x)(x^2+6)/8,@(x)x/4,0,0.0001)

PROGRAM & RESULT


function[]=SC_SAM(gun,dgun,x1,acc)
y=feval(dgun,x1);
while y>1
x1=input('Enter the value of x0:');
y=feval(dgun,x1);
end
x2=feval(gun,x1);
while abs(x2-x1)>acc
x1=x2;
x2=feval(gun,x1);
end
fprintf('The root is %f\n',x2);

The root is 0.837715

Published with MATLAB® 8.0

You might also like