check for decrease and increase

29 ビュー (過去 30 日間)
johnson saldanha
johnson saldanha 2018 年 11 月 5 日
コメント済み: Image Analyst 2021 年 11 月 23 日
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.

採用された回答

KSSV
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.

その他の回答 (3 件)

madhan ravi
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

Image Analyst
Image Analyst 2018 年 11 月 5 日
編集済み: Image Analyst 2021 年 11 月 23 日
Try the function findchangepts(), in versions of MATLAB r2016a and later.

Palnati saidatta
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 件のコメント
Image Analyst
Image Analyst 2021 年 11 月 23 日
@Palnati saidatta, isn't this just the same answer as @madhan ravi?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by