find local minima within a time window of interest
Show older comments
To do the plot I have the X values and the Y values.
I need to find the local minima within a specific time-window (250-350) in the x axes.
How can I do it?

Accepted Answer
More Answers (1)
Yongjian Feng
on 11 Nov 2021
You first need to figure out idx range of X for 250-350. Called them idx_start and idx_end.
Then just
min(Y(idx_start:idx_end))
4 Comments
Melissa Jones
on 11 Nov 2021
Melissa Jones
on 11 Nov 2021
Yongjian Feng
on 11 Nov 2021
Edited: Yongjian Feng
on 11 Nov 2021
Try this:
idx_start = find(X>=250, 1);
idx_end = find(X>=350, 1);
Adjust the condition above whether you want X>= or just X>.
Melissa Jones
on 11 Nov 2021
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!