powered by
Trapezoidal integration in 1 or 2 dimensions
trapz(h, fx)
The trapezoidal approximation of the integral.
A length d numeric vector of grid widths.
d
A d-dimensional array (or a vector, if d=1).
d=1
# 1D example trapz(h = 1, fx = 1:10) # 2D example trapz(h = c(1,1), fx = matrix(1:10, nrow = 2))
Run the code above in your browser using DataLab