Sub simp38()
a = 0
b = 120
n = 3
h = (b - a) / n
I = h * (f(a) + f(b)) / 2
For m = 2 To n
I = I + f(a + h * (m - 1)) * h
Next
Range("b3").Value = I
End Sub
my given
x | 0 | 20| 40 |60 |80 |100 |120|
y| 0 |7.4 |11.8 |15.2 |15| 9.2 |0.2|
h= 20 n= 6 segments
im really a new in this and dont have any background in this type of program, i hope you can help me
a = 0
b = 120
n = 3
h = (b - a) / n
I = h * (f(a) + f(b)) / 2
For m = 2 To n
I = I + f(a + h * (m - 1)) * h
Next
Range("b3").Value = I
End Sub
my given
x | 0 | 20| 40 |60 |80 |100 |120|
y| 0 |7.4 |11.8 |15.2 |15| 9.2 |0.2|
h= 20 n= 6 segments
im really a new in this and dont have any background in this type of program, i hope you can help me