Finding local minimums/maximums for a set of data
Mostra commenti meno recenti
Hi, I have a set of data which oscillates between minimums and maximum values. The min and max values change slightly over time. I want to see the trend of changing of min and max values over time. In order to do that, it seems that I need to extract the local min and local maximums.
Is there any function to extract the local minimums and maximums of the following graph?
Thanks.

4 Commenti
Martin Elenkov
il 10 Mar 2016
Is this Electrical Impedance Tomography(EIT) data? I have the same problem, where I have to determine the time interval where an dynamic Computed Tomography scan is made during the EIT. I thought I can determine the peak distances and then meet some kind of a decision to determine this time interval.
Here is my signal

Image Analyst
il 10 Mar 2016
Start your own question and explain more about what's in the red circles that you want. Otherwise just threshold and call diff() and look for +1 values.
binarySignal = signal > 2.56;
leadingEdges = find(diff(binarySignal) >= 1);
You can get the distance between leading edges by doing diff(leadingEdges).
Steev Mathew
il 4 Mar 2021
Thanks! This helped me a lot. I was looking for a way to filter out noise from my data.
Anupama V
il 6 Nov 2022
How to find the valley of a ppg signal?(secondary peak of a signal)
Risposta accettata
Più risposte (5)
Steven Lord
il 4 Mar 2021
2 voti
For more recent releases take a look at the islocalmin, islocalmax, and (perhaps) detrend functions.
Si14
il 26 Lug 2012
2 Commenti
Star Strider
il 26 Lug 2012
Thank you for accepting my answer!
Umesh Gautam
il 11 Mag 2023
It is working great.
Image Analyst
il 22 Lug 2012
Modificato: Image Analyst
il 22 Lug 2012
0 voti
If you have the Image Processing Toolbox, you can use imregionmax() and imregionalmin(). Do you have that toolbox? If you do that would be the simplest because it's just simply one line of code to find either the maxs or the mins.
You can also do it by seeing where the morphological max or min (performed by imdilate() and imerode() respectively) equals the original array. But again, that requires the Image Processing Toolbox.
Randy82
il 13 Ago 2014
0 voti
I have one question: Why do i have to multiply max(Data) with a factor 1.01?
1 Commento
Star Strider
il 13 Ago 2014
To keep all the values of the inverted vector > 0.
Prithisha K
il 8 Set 2021
0 voti
Set the prominence window value to 25. Then increase the min.prominence value untill there are exactly 9 minima found.
Categorie
Scopri di più su Descriptive Statistics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!