Effacer les filtres
Effacer les filtres

Ideas for creating an Automatic Threshold value from a variable vector

3 vues (au cours des 30 derniers jours)
Mariana
Mariana le 20 Déc 2022
Commenté : Mariana le 20 Déc 2022
Hi guys!
I'm dealing with a vector variables (of double type) which values varies depending the system is analyzed (its dimension also varies depending the characteristic of the system).
For example, lets suppose i have the following vector of numbers,
Error=[0.2 0.35 0.5 0.25 0.4 0.15 0.45 1.5 2.5 2].
You can observe that the 7th first values are lower than the last ones. So I would like to set an automatic Threshold that only include only the 7th first values of the vector, since they are significantly smaller than the last ones.
As you can see, since my system can chance, i need that the Threshold value change with it.
Thanks a lot for any idea!
  2 commentaires
Walter Roberson
Walter Roberson le 20 Déc 2022
You need to decide how to tell whether a set of values are "significantly smaller" than other ones.
I notice that your values increase and decrease. What do you want to have happen if the values rise to "significant" in the middle but with "insignificant" between that and the end? Such as
Error=[0.2 0.35 0.5 1.25 0.4 0.15 0.45 1.5 2.5 2].
supposing that 1.25 is "significant" in this context.
Mariana
Mariana le 20 Déc 2022
Thanks for your answer, Walter.
In the phenomenum i'm studying, there would not be that case (a significantly variation in the middle of the vector).
I have no any way to quantify how bigger the last values are than the 7th first values, i only know that they will be discrepant from them.

Connectez-vous pour commenter.

Réponse acceptée

Steven Lord
Steven Lord le 20 Déc 2022
Take a look at the ischange function.
Error=[0.2 0.35 0.5 0.25 0.4 0.15 0.45 1.5 2.5 2];
changepoint = ischange(Error);
results = table(Error.', changepoint.', 'VariableNames', ["Error", "Change Point"])
results = 10×2 table
Error Change Point _____ ____________ 0.2 false 0.35 false 0.5 false 0.25 false 0.4 false 0.15 false 0.45 false 1.5 true 2.5 false 2 false

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements 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