How to find increasing data points in an array?
显示 更早的评论
There's an array of random elements A=[2 1 4 2 6 7 8 10 12 14 16 18 20 22 24 12 10 9 11 8 ] now here from n=5 the value sarts increasing till n=15 position. My target is to find this increasing data points in the array and determine their position and remove those data points as well. I have already tried with diff function but I am not getting the results which I want. How can I do it? if someone say it would be of really great help.
1 个评论
Jiri Hajek
2022-12-7
编辑:Jiri Hajek
2022-12-7
Hi, I believe the diff function is a good starting point. The method you need requires to identify clusters of array elements, which you can do using the result of diff. It's not too difficult, but as often, devil is in the detail. If you need to make the method robust and applicable to any vector size, you must start by a precise definition of all possibile scenarios (single largest cluster, several same-size clusters, strictly increasing clusters or non-decreasing clusters etc.).
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!