for k=1:15 %0--15度
for n=1:48
t0=n/48*0.02; t1=(n+1)/48*0.02;t2=(n+2)/48*0.02;
% t=(n+1)/48*0.02+0.02/N/sqrt(3);
h=(2/48*0.02)/10;
a=0;
for t=t0:h:t2
II(n+(k-1)*N)=sin(100*pi*t+(k-1)/180*pi); 原函数
III(n+(k-1)*N)=(t-t1)*(t-t2)/(t0-t1)/(t0-t2)*sin(100*pi*t0+(k-1)/180*pi)+(t-t0)*(t-t2)/(t1-t0)/(t1-t2)*sin(100*pi*t1+(k-1)/180*pi)+(t-t0)*(t-t1)/(t2-t0)/(t2-t1)*sin(100*pi*t2+(k-1)/180*pi);二次插值函数
Rmax(n+(k-1)*N)=abs(II(n+(k-1)*N)-III(n+(k-1)*N)); 求解两者的误差
if Rmax(n+(k-1)*N)>a
a=Rmax(n+(k-1)*N);
end
end
Rmax(n+(k-1)*N)=a;
end
end