function duoxaingshi
%y_nh=a0+a1*x+a2*x^2+a3*x^3
clear
clc
x=[1,2,3,4,5,6,7,8,9,10];
y=[2615,1943,1494,1087,765,538,484,290,226,204];
% plot(x,y,'*');
m=length(x);
% n=4;
s_x=0;
s_xx=0;
s_xxx=0;
s_xxxx=0;
s_xxxxx=0;
s_xxxxxx=0;
s_y=0;
s_xy=0;
s_xxy=0;
s_xxxy=0;
pc=0;
for i=1:m
%求解X矩阵的元素
s_x=s_x+x(i);
s_xx=s_xx+x(i).*x(i);
s_xxx=s_xxx+x(i).*x(i).*x(i);
s_xxxx=s_xxxx+x(i).*x(i).*x