select/ extract only increasing part among both increasing and decreasing set of data
3 ビュー (過去 30 日間)
古いコメントを表示
I have a data set which initially increases and then decreases. I want to select/ extract only increasing part. How shall I do this?
0 件のコメント
回答 (1 件)
Walter Roberson
2019 年 5 月 1 日
locs = strfind([diff(DATA)<0,true], [0 1]) + 1;
DATA(1:locs(1))
The code was written like this to have protection for the case where the data is all ascending. You could also find(diff(DATA)<0,1) and test for isempty()
参考
カテゴリ
Help Center および File Exchange で Call C++ from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!