How to fit two equations to one dataset

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

Hi Yolanda,
You could just plot the Upper curve and not plot the lower curve when you plot your dataset. else, based on your requirement, you can sent conditions in your code to select only the points which are above a particular threshold(for example). Hope this answers your question.
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?
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)

data(data < -10) = [];

2 Comments

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!
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 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 17 Nov 2015

Commented:

on 19 Nov 2015

Community Treasure Hunt

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

Start Hunting!