Z=[1 10.5;
2 11.3;
3 12.6;
4 13.8;
5 14.9];
X=Z(:,1);
N=ones(5,1);
C=[N X X.^2];
Y1=Z(:,2);
A=C'*C;
b=C'*Y1;
c=(A^-1)*b;
Y2=c(1,1)*ones(5,1)+c(2,1)*X+c(3,1)*(X.^2);
delta_Y=Y2-Y1;
PV=max(delta_Y)-min(delta_Y);
RMS=sqrt(sum(delta_Y.*delta_Y,1));
Z=[1 10.5;
2 11.3;
3 12.6;
4 13.8;
5 14.9];
X=Z(:,1);
N=ones(5,1);
C=[N X X.^2];
Y1=Z(:,2);
A=C'*C;
b=C'*Y1;
c=(A^-1)*b;
Y2=c(1,1)*ones(5,1)+c(2,1)*X+c(3,1)*(X.^2);
delta_Y=Y2-Y1;
PV=max(delta_Y)-min(delta_Y);
RMS=sqrt(sum(delta_Y.*delta_Y,1));