findpeaks for different thresholds
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
AHN
am 23 Jan. 2019
Kommentiert: AHN
am 25 Jan. 2019
Hi,
I am trying to find pks and locs for different threshold values. For one threshold value, this has worked fine. But for different threshold values (randomly generated), is there a way to store all the values of pks and locs? I would ideally like, for example, for threshold=x1, results in [pks1,locs1] format..for threshold=x2, results in [pks2,locs2] format and so on. Please let me know.
Thank you!
2 Kommentare
Akzeptierte Antwort
Walter Roberson
am 23 Jan. 2019
Thresholds = linspace(x1,x2,n);
for thresh_idx = 1 : length(Thresholds)
Threshold1=linspace(x1,x2,n);
[pks, locs] = findpeaks(data, 'MinPeakHeight', Threshold1);
Results(thresh_idx).Threshold1 = Threshold1;
Results(thresh_idx).pks1 = pks;
Results(thresh_idx).locs1 = locs;
end
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!