check for decrease and increase

39 Ansichten (letzte 30 Tage)
johnson saldanha
johnson saldanha am 5 Nov. 2018
Kommentiert: Image Analyst am 23 Nov. 2021
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.

Akzeptierte Antwort

KSSV
KSSV am 5 Nov. 2018
Read about diff. This will get the difference of successive rows. If decreasing diff would be negative, if increasing diff will be positive.

Weitere Antworten (3)

madhan ravi
madhan ravi am 5 Nov. 2018
Bearbeitet: madhan ravi am 5 Nov. 2018
x=[100:-5:0] %an example
issorted(x,'strictdescend') %to check if they are sorted
abs(diff(x))==5

Image Analyst
Image Analyst am 5 Nov. 2018
Bearbeitet: Image Analyst am 23 Nov. 2021
Try the function findchangepts(), in versions of MATLAB r2016a and later.

Palnati saidatta
Palnati saidatta am 23 Nov. 2021
x=[100:-5:0] %an example
issorted(x,'strictdescend') %to check if they are sorted
abs(diff(x))==5

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by