If the signal S consists of several peaks as a function of time, is there a way to assign integration limits for the trapezoidal rule? Say, I would like to integrate peak 1 from 5 to 7 min, then there is another peak 2 which needs to be integrated from 7.5 to 9.5 minutes. The documentation for trapezoidal rule does not mention anything about limits. Assume we do not know the functional form of the peaks. Thanks.

# MATLAB: Integration via trapezoidal rule in various sections of the same array

numerical integrationtrapezoidal rule

###### Related Question

- How to find peaks for a graph plotted in semi-log axes and to extract the values of peak and FWHM
- How to find n values before and after a maximum of an array
- Peak width calculation methods
- Finding several local maximum values in a given range and corresponding indices
- Remove peaks below a threshold using findpeaks function
- Can you limit findpeaks to only look for odd peaks (i.e. search 1st, 3d, 5th, etc. peaks)
- Matlab code for Numerical analysic

## Best Answer