Split non-bijective function into two bijective regions
Show older comments

I have a model which generates a large number of samples (i.e. a set of x values and a set of y values). The output roughly follows the shape of the curve pictured, so that there are two y values for each x value. The data is not sorted by x or y.
I would like to split this dataset into two bijective datasets, representing points above and below the marked X. (This will then allow me to interpolate between points on the upper portion of the curve, where otherwise interpolation would bounce up and down between the two parts of the curve.)
My initial approach was to find the co-ordinates of the marked X, xX and yX, and assign the two datasets according to y > yX and y < yX. However, there are a handful of points on the bottom portion of the curve that can sometimes have y > yX, so this doesn't work.
Can anyone suggest a potential solution to this problem?
4 Comments
Dyuman Joshi
on 3 Oct 2023
What is the criteria for defining the point X on the graph to be used for separation?
Bruno Luong
on 3 Oct 2023
Please share your data
Accepted Answer
More Answers (0)
Categories
Find more on Spline Postprocessing 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!
