Find consecutive values in a vector that are above a threshold
Show older comments
Hi everyone,
I have a vector of monthly values. I would now like to identify periods of months where the values exceeded my threshold for 5 months. I know I can find all the individual months with the find function but how do I add this extra condition saying, only show me their position if five months in a row exceeded the threshold?
thank you so much for any hint. Sandra
1 Comment
Azzi Abdelmalek
on 31 May 2013
Can you explain with an example?
Accepted Answer
More Answers (1)
Youssef Khmou
on 31 May 2013
Edited: Youssef Khmou
on 31 May 2013
hi you can find function with multiple output that show the indices :
v=1:10;
[r,c]=find(r>5);
c represents the indices not the values , to make it more clear :
v=wrev(v);
[r,c]=find(r>5);
Categories
Find more on Vector Fields 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!