check for decrease and increase
34 次查看(过去 30 天)
显示 更早的评论
i have a matrix and check for a column to see if the values are rapidly decreasing in steps of five. how to check for it? for example the matrix is x and the second column.
0 个评论
采纳的回答
KSSV
2018-11-5
Read about diff. This will get the difference of successive rows. If decreasing diff would be negative, if increasing diff will be positive.
0 个评论
更多回答(3 个)
madhan ravi
2018-11-5
编辑:madhan ravi
2018-11-5
x=[100:-5:0] %an example
issorted(x,'strictdescend') %to check if they are sorted
abs(diff(x))==5
0 个评论
Image Analyst
2018-11-5
编辑:Image Analyst
2021-11-23
Try the function findchangepts(), in versions of MATLAB r2016a and later.
0 个评论
Palnati saidatta
2021-11-23
x=[100:-5:0] %an example
issorted(x,'strictdescend') %to check if they are sorted
abs(diff(x))==5
1 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!