y=y';
n=length(y);
x1=1:n;
x2=1:n;
x1=x1';
x2=x2';
alpha=0.05;
x=[ones(n,1),x1,x2];
[b,bint,r,rint,stats]=regress(y,x,alpha);
y=y';
n=length(y);
x1=1:n;
x2=1:n;
x1=x1';
x2=x2';
alpha=0.05;
x=[ones(n,1),x1,x2];
[b,bint,r,rint,stats]=regress(y,x,alpha);