主题:polyfit的问题!高手来啊
x=[2000:2006];
y1=[105.5 107.2 116.4 116.6 113.9 106.4 102.2];
y2=[104.9 105.8 106.9 106.1 111.7 109.7 102.6];
y3=[98.6 104.4 107.3 120.1 115.9 109.7 98.7];
p1=polyfit(x,y1,2);
p2=polyfit(x,y2,2);
p3=polyfit(x,y3,2);
x1=[1990:0.1:2006];
y11=polyval(p1,x1);
y21=polyval(p2,x1);
y31=polyval(p3,x1);
subplot(1,3,1)
plot(x,y1,'*r',x1,y11,'-b')
subplot(1,3,2)
plot(x,y2,'*r',x1,y21,'-b')
subplot(1,3,3)
plot(x,y3,'*r',x1,y31,'-b')
Warning: Polynomial is badly conditioned. Remove repeated data points
or try centering and scaling as described in HELP POLYFIT.
为何会如此??????????帮帮忙啊,急啊!!!!
y1=[105.5 107.2 116.4 116.6 113.9 106.4 102.2];
y2=[104.9 105.8 106.9 106.1 111.7 109.7 102.6];
y3=[98.6 104.4 107.3 120.1 115.9 109.7 98.7];
p1=polyfit(x,y1,2);
p2=polyfit(x,y2,2);
p3=polyfit(x,y3,2);
x1=[1990:0.1:2006];
y11=polyval(p1,x1);
y21=polyval(p2,x1);
y31=polyval(p3,x1);
subplot(1,3,1)
plot(x,y1,'*r',x1,y11,'-b')
subplot(1,3,2)
plot(x,y2,'*r',x1,y21,'-b')
subplot(1,3,3)
plot(x,y3,'*r',x1,y31,'-b')
Warning: Polynomial is badly conditioned. Remove repeated data points
or try centering and scaling as described in HELP POLYFIT.
为何会如此??????????帮帮忙啊,急啊!!!!