title(‘临近插值’)
%球面线性插值
y3 = interp1(x,y,xx,’spline’);
subplot(2,2,3);
plot(x,y,’o’,xx,...y3,’r’)
title(‘球面插值’)
%三次多项式插值法
y4 = interp1(x,y,xx,’pchip’);
subplot(2,2,4);
plot...%临近插值
y2=interp1(x,y,xx,’nearest’);
figure
plot(x,y,’o’,xx,y2,’r’);
title(‘临近插值’)
%球面线性插值...y3=interp1(x,y,xx,’spline’);
figure
plot(x,y,’o’,xx,y3,’r’)
title(‘球面插值’)
%三次多项式插值法
y4...参量x 指定数据Y的点。若Y为一矩阵,则按Y的每列计算。yi是阶数为length(xi)*size(Y,2)的输出矩阵。