CAD/CAM技术及应用
error('MATLAB:interp1:ppinterp:UnknownMethod', ... 'Unrecognized method.');
end
% Even if method is 'spline' or 'pchip', we still need to record that the % input data Y was oriented according to INTERP1's rules.
% Thus PPVAL will return YI oriented according to INTERP1's rules and % YI = INTERP1(X,Y,XI,METHOD) will be the same as
% YI = PPVAL(INTERP1(X,Y,METHOD,'pp'),XI)
pp.orient = 'first';
end % PPINTERP
end % INTERP1
x=[1 2 3 4 5];
y=[1.4 1.5 1.7 2.2 3];
x1=1:0.1:5;
y1=interp1(x,y,x1,'spline');
plot(x,y,'o',x1,y1,'r:');
grid on
生成后的图像为: