I have a set of xy points:
x = [1 2 3 3 2]
y = [1 1 2 3 2]
I would like to do an interpolation of those point. My issue is, interp1() or splin() require a strictly ecreasing x.
How can I get an interpolation like this:
x = [1 2 3 4 5]
y = [1 1 2 3 2]
xx = linspace(1, 5, 100);
yy2 = interp1(x, y, xx, 'spline');
plot(xx',yy2)
scatter(x, y)
But with a non increasing x ?
I do not only need the plot, but also get the interpolation value for a given x and y.