Ideas for creating an Automatic Threshold value from a variable vector

3 次查看(过去 30 天)
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 个评论
Walter Roberson
Walter Roberson 2022-12-20
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 2022-12-20
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.

请先登录,再进行评论。

采纳的回答

Steven Lord
Steven Lord 2022-12-20
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by