from Curve Interpolation by Cristian corvino
Which is the better solution to interpolate data no spaced equally?

splineprov.m
n_adm240=[0.275 0.3 0.4 0.5 0.6 0.7 0.8 0.88 0.9 0.95 0.951];
P_adm240=[0.2 0.21 0.25 0.325 0.375 0.475 0.56 0.68 0.975 0.8 0.925];
% t=linspace(0,1,11);
t=(0.25:0.07:1);
% t=(0:0.1:1);
yt=pchip(n_adm240,P_adm240,t);
ys=spline(n_adm240,P_adm240,t);
yi=interp1(n_adm240,P_adm240,t,'linear');
plot(n_adm240,P_adm240,'o',t,yt,'-',t,ys,'.-',t,yi,'x-');
legend('data','pchip','spline','interp1',4)

Contact us at files@mathworks.com