Professional Documents
Culture Documents
Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1
OUTPUT ........................................................................................................................... 1
SOLVER ........................................................................................................................... 1
INPUT
SC_GLM3(1,4,@(x)(x^3+x-1))
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);
OUTPUT
The value of the given integration is 68.250000
SOLVER
• quad(@(x)(x.^3+x-1)1,4)
• ans = 68.2500