Find minimum or maximum value - two conditions
Mostra commenti meno recenti
Hi there,
I have a problem where I am trying to find the index of minimum or maximum values based on two conditions. I have separated my data into 10 second blocks, with 1 data point per second. The two conditions are as follows:
1) the next minimum value must not be within 5 seconds of the previous minimum value
2) the next minimum value must be within the 10 second block following the previous minimum value's 10 second block.
Presently, I can ensure the next indexed minimum value meets one condition or the other, but I cannot ensure that it meets both.
Any ideas would be much appreciated!
Luke
3 Commenti
Image Analyst
il 9 Mag 2023
Have you tried a for loop? You forgot to attach your data and expected result, which would enable us to provide a solution to you sooner.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
LukeJes
il 10 Mag 2023
Risposte (1)
Steven Lord
il 9 Mag 2023
1 voto
I think the islocalmin and islocalmax functions will be of use to you. See the MinSeparation name-value argument.
2 Commenti
LukeJes
il 10 Mag 2023
Categorie
Scopri di più su Loops and Conditional Statements 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!