MATLAB: How to calculate area under each peak from the plot

peak ara

I want to calculate the aria under my plot and after for each peack. How can i do that? I have attached the data for plot and a picture of each zone that i need the area.

Best Answer

See if this does what you want:
D = load('data for plot.txt');
x = 0:numel(D)-1; % Choose The Appropriate Vector For The Most Accurate Results
[pks,locs] = findpeaks(-D); % ‘Trough’ Minima Between Peaks
IntTot = cumtrapz(x,D); % Integrate
IntPks = diff(IntTot(locs)); % Peak Areas
IntPks =
0.45474
0.08047
0.15185
0.20436
0.25881
0.0068099