I have data which contains peaks that I want to detect with the function findpeaks from the Signal Processing Toolbox, in Matlab.
You will understand my problem with some images :

-> Here you have my data in red, and the finding peaks in blue ; with this code :
[peakHeight, peakLocation] = findpeaks(data,'minPeakHeight',4.3);
I wanted to only keep the first ones (yellow circles). Sometimes, the first peak in my "red block" is not at the yellow circles location, like this :
I tried many parameters of findpeaks, like 'MinPeakProminence','Threshold' and 'MinPeakDistance', but the best I obtain is this, with findpeaks(data,'minPeakHeight',4.3,'MinPeakProminence',4); :
As my peaks in my data are not really flat, I don't always keep the first good ones.
In my research I found and tried this : islocalmax(data,'FlatSelection','first');, but it doesn't work well too.
To sum up, I want to have one peak for every "red block". And these peaks need to be just after the rise. So please, have you some idea to solve my problem ? Thanks :)


