MATLAB: FInd maximum in cubic spline interpolant

maximumspline interpolant

I got a set of data, x and y
I was trying to find an eqaution that bu basic fitting and it comes out that spline interpolant is the best one to fit in. (quad and cubic has a peak lower than actual value, so i can not use them)
Now, I want an actual equation that represents a line between two point.
Also I want to find a maximum y-value in a line of cubic spline interpolant, not from the actual data.
I tried findpeak, but it display the y-vale from my data.
So is there a way to do it??
x =
0.7000
0.7500
0.8000
0.8500
0.9000
0.9500
1.0000
1.0500
1.1000
1.1500
1.2000
1.2500
1.3000
y =
1.0e+003 *
1.8367
1.9180
1.9953
2.0677
2.1333
2.1883
2.2251
2.2318
2.2097
2.1746
2.1356
2.0958
2.0562
plot (x,y)
using basic fit tool, clicked on a spline interpolant
and got stuck from here
Cheers,

Best Answer

EDIT
new data
x = [0.70000
0.75000
0.80000
0.85000
0.90000
0.95000
1.00000
1.05000
1.10000
1.15000
1.20000
1.25000
1.30000];
y = [1836.7
1918.0
1995.3
2067.7
2133.3
2188.3
2225.1
2231.8
2209.7
2174.6
2135.6
2095.8
2056.2];
for MATLAB R2013a and later
[~,ii] = findpeaks(y);
F = griddedInterpolant(x,y,'spline');
xmaxs = arrayfun(@(xx)fminsearch(@(x)-F(x),xx),x(ii));
x1 = linspace(x(1),x(end),100);
plot(x,y,'go',x1,F(x1),'b-',xmaxs,F(xmaxs),'r+');
for older releases MATLAB
[~,ii] = findpeaks(y);
F = interp1(x,y,'spline','pp');
xmaxs = arrayfun(@(xx)fminsearch(@(x)-ppval(F,x),xx),x(ii));
x1 = linspace(x(1),x(end),100);
plot(x,y,'go',x1,ppval(F,x1),'b-',xmaxs,ppval(F,xmaxs),'r+');