How to judge the relatively stable section in the curve

1 view (last 30 days)
This is a curve. The relatively stable part in the red box is what I need. How can I automatically judge and recognize it.Can you give a simple automatic judgment code?
  4 Comments

Sign in to comment.

Answers (1)

Matt J
Matt J on 21 Jan 2022
Edited: Matt J on 21 Jan 2022
One possibility might be to look at the local span seminorm (max-min) over a sliding window.
window=50;
lookahead = movmax(curve,0,window)-movmin(curve,0,window)<=tolerance;
lookbehind = movmax(curve,window,0)-movmin(curve,window,0)<=tolerance;
start=find(lookahead,1,'first'); %start of stable interval
stop=find(lookbehind,1,'last'); %end of stable interval.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!