MATLAB: How to find a unique point of a set of data

inflectioninterpolation

I am given a set of data, P and Phase. I have plotted this data and now I want to find a point on the line which can be used to characterize the line – so for example the inflection point, which should be unique. Probably I will have to interpolate the data first, maybe using:
P_intrp = linspace(min(P),max(P),100)
data_intrp = interp1(P,Phase,P_intrp,'spline');
But what now? I think I can find the inflection point by setting the second derivative to 0. There is no point in my line with first derivative equal to 0.
idx = find(P,diff(diff(data_intrp)) = 0);
P_infl = P(idx);
Phase_infl = data_intrp(idx);
I don't know, if this would work. It's important to me to know which value of P belongs to the inflection point. I also want to know the corresponding Phase.
further information: I want to find such a unique point, in order to find out how the following lines can be obtained from each other just by displacement:

Best Answer

If you want to inflection points in the data you plotted over the range that you plotted, you might not be successful. I don’t see any inflection points.
I would use the gradient function (not diff) to calculate the derivatives, since the output is the same length as the input vector, and this simplifies your code.