You have a relationship that does not represent a single valued function, y(x).
The simple answer is to use cscvn to do the fit. fnplt can plot the resulting curve. They should be in the curve fitting toolbox. Or another lazy solution is to use my own interparc , as found on the file exchange. For the example you have shown, a simple solution that would not require anything sophisticated would be to work in a parametric form, where the relationship was single valued. So, for example, convert to polar coordinates, around some central point. Then merely fit r as a function of theta using a spline. Of course, that does require some knowledge about the problem, and there are many curves that would still fail by such an approach. A curve that represented a figure 8 for example.
Other solutions which you would do yourself would also require a parametric fit, for example, a cumulative arc length parameterization. This in fact, is how both cscvn and interparc work their magic.
Best Answer