How to fit two equations to one dataset

1 view (last 30 days)
Yolanda Gu
Yolanda Gu on 17 Nov 2015
Commented: John D'Errico on 19 Nov 2015
I have one dataset and I plotted it in a graph, see the attached image. the plotted data has two distinct trends, I want to delete the lower one only keep the larger(middle) one. How can I do that?
Thanks in advance!
  3 Comments
Yolanda Gu
Yolanda Gu on 19 Nov 2015
Thanks Saryajeet, what if this plot is actually dynamic? for example in the plot above,-10 seems to be the threshold, but in other scenarios 0 might be the threshold. How can I easily determine where my threshold is?
John D'Errico
John D'Errico on 19 Nov 2015
But that depends on what you know about these curves! You know what separates them. I could come up with a scheme that separates these particular curves. But you might have a huge variety of curves that are not so easily separated. So we would need to know what you know about the curves to really help you.

Sign in to comment.

Answers (1)

Thorsten
Thorsten on 19 Nov 2015
data(data < -10) = [];
  2 Comments
Yolanda Gu
Yolanda Gu on 19 Nov 2015
Thanks Thorsten, is there an easy way to make that -10 a dynamic number based on the look of the curves? the curve shape will change when I type in different parameters. How can I easily determine what the threshold is? Thanks!
Yolanda Gu
Yolanda Gu on 19 Nov 2015
For example, when I type a different parameter, I got a graph like this, where now I only want to keep the lower curve,and the threhold seems to be around 78 now. The equation I have will always create two curves, one long and one short, I only want to keep the long one never the short.

Sign in to comment.

Categories

Find more on Two y-axis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!