主要是是对一些数据进行拟合,并画出曲线。程序如下: t=1:9;
x=[12.51,13.54,15.60,15.92,20.64,24.53,30.24,50.00,36.34];
y=[9.87,20.54,32.51,40.50,48.31,64.51,72.22,85.98,89.77];
a8=polyfit(t,x,8);
b8=polyfit(t,y,8);
ti=linspace(1,9);
xi8=polyval(a8,ti);
yi8=polyval(b8,ti);
plot(t,x,'o',ti,xi8,'k')
hold on;
plot(t,y,'*',ti,yi8,'k')
Warning: Polynomial is badly conditioned. Remove repeated data points
or try centering and scaling as described in HELP POLYFIT.
> In polyfit at 79
Warning: Polynomial is badly conditioned. Remove repeated data points
or try centering and scaling as described in HELP POLYFIT.
> In polyfit at 79
可以画出图形如上:为什么可以作图,他还出现警告了,哪位高手知道怎样修改,使它变得更加完美,没有Warning.