cumtrapz

Cumulative numerical integration of discrete data using the trapezoid rule.

Syntax

area=cumtrapz(x,y)

Inputs

x
Values of the domain variable.
Type: double
Dimension: vector
y
Values of the range variable.
Type: double
Dimension: vector

Outputs

area
The estimated cumulative area.
Dimension: scalar | matrix

Example

x = [0:0.05:1]*pi; area = cumtrapz(x,sin(x))
area = [Matrix] 1 x 11 0.00000 0.04854 0.18941 0.40882 0.68529 0.99176 1.29823 1.57470 1.79411 1.93498 1.98352

Comments

cumtrapz is appropriate for use with sampled data when the function is not available.