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