You are on page 1of 1

GAUSS 3-POINT METHOD

Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1
OUTPUT ........................................................................................................................... 1
SOLVER ........................................................................................................................... 1

Name : Shubham Chapparghare Roll no. : 351013

INPUT
SC_GLM3(1,4,@(x)(x^3+x-1))

PROGRAM & RESULT


function[]=SC_GLM3(x0,xn,fun)

c=(xn-x0)/2;
d=(xn+x0)/2;
x1=c*(-1)*(3/5)^(0.5)+d;
x2=c*(3/5)^(0.5)+d ;
x3=d;
y1=feval(fun,x1);
y2=feval(fun,x2);
y3=feval(fun,x3);
i=c*((5/9)*y1+(5/9)*y2+(8/9)*y3);
fprintf('The value of the given integration is %f\n',i);

The value of the given integration is 68.250000

OUTPUT
The value of the given integration is 68.250000

SOLVER
• quad(@(x)(x.^3+x-1)1,4)

• ans = 68.2500

Published with MATLAB® R2017a

You might also like