You are on page 1of 1

GAUSS 2-POINT METHOD

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

Name : Shubham Chapparghare Roll no. : 351013

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

PROGRAM & RESULT


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

c=(xn-x0)/2;
d=(xn+x0)/2;
x1=c*(-1)*(1/3)^(0.5)+d;
x2=c*(1/3)^(0.5)+d ;
y1=feval(fun,x1);
y2=feval(fun,x2);
i=c*(y1+y2);
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

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

• ans = 68.2500

Published with MATLAB® R2017a

You might also like