Effacer les filtres
Effacer les filtres

check for decrease and increase

25 vues (au cours des 30 derniers jours)
johnson saldanha
johnson saldanha le 5 Nov 2018
Commenté : Image Analyst le 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.

Réponse acceptée

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

Plus de réponses (3)

madhan ravi
madhan ravi le 5 Nov 2018
Modifié(e) : madhan ravi le 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 le 5 Nov 2018
Modifié(e) : Image Analyst le 23 Nov 2021
Try the function findchangepts(), in versions of MATLAB r2016a and later.

Palnati saidatta
Palnati saidatta le 23 Nov 2021
x=[100:-5:0] %an example
issorted(x,'strictdescend') %to check if they are sorted
abs(diff(x))==5
  1 commentaire
Image Analyst
Image Analyst le 23 Nov 2021
@Palnati saidatta, isn't this just the same answer as @madhan ravi?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by