You are on page 1of 1

X =[0 1 -2 2];

Y =[-1 3 2 5];
syms x
f = fdiff(X,Y)
f =
- x*(((17*x)/24 - 5/12)*(x - 1) - 4) - 1
subs(diff(f,x),x,0)
ans =
3.5833
romberg(f,-2,2,5)
ans =
14.0000
5.0000
2.7500
2.1875
2.0469
2.0117
diary off

0
2.0000
2.0000
2.0000
2.0000
2.0000

0
0
2.0000
2.0000
2.0000
2.0000

0
0
0
2.0000
2.0000
2.0000

0
0
0
0
2.0000
2.0000

0
0
0
0
0
2.0000

You might also like