Find coordinates of border in findpeaks plot
Afficher commentaires plus anciens
Hi all,
I am struggling to find the cooridnates for the borders value while using the findpeaks function.
Here is a picture of my plot:

I would need to find the x coordinates of the borders between the peaks. I am doing so in order to get the duration of each peak delimited by the purble borders.
My code right now looks like this:
load('pO2,Mean,Numeric,Float,Raumedic,data_part1of1.mat');
ox = measurement_data;
smooth_ox = smooth(ox, 0.01, 'loess');
%find peaks
[pks,locs,wdths] = findpeaks(smooth_ox,'MinPeakProminence',0.5);
locmax = islocalmax(smooth_ox);
%plot
figure()
findpeaks(smooth_ox,'MinPeakProminence',0.5,'Annotate','extents',...
'WidthReference','halfheight')
text(locs+.02,pks,num2str((1:numel(pks))'))
title('Peaks')
Thank you for the help!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
