Sub rectangle()
Sheets("Sheet1").Select
Dim integral As Double, delta As Double, start As Double, last As Double
Dim n As Integer
start = 0
n = 10
last = 1
delta = (last - start) / n
integral = 0
For i = 1 To n
integral = integral + delta * fval(start + (i - 1) * delta)
Next
Cells(1, 1) = integral
End Sub
No comments:
Post a Comment