integrate.m
SYNTAX: integral = integrate(y,x,x1,x2,dx)
PURPOSE: Calculate definite integral of y from x1 to x2 (approx.).
INPUT:
y = data y(x) to integrate
x = independent variable corresponding to data y
x1 = lower limit of integration
x2 = upper limit of integration
dx = fixed sampling rate (optional, default = compute from vector x)
OUTPUT:
integral = value of (approximate) integral
RESTRICTIONS:
(1) Right now, requires FIXED sampling rate. Can be upgraded
to handle multiple sampling domains with some work.
(2) To integrate from -infinity use x(1), to +infinity use x(end).
This assumes that support of function y is captured by vector x.
See also: integrate_t
Dependencies