x=2:6;
y=[2.2,3.8,5.5,6.5,7.0];
A=polyfit(x,y,1);
a=A(1)
b=A(2)
plot(x,y,'r*');hold on;
plot(x,a*x+b);hold off;%y=ax+b
a =
1.2300
b =
0.0800
x=2:6;
y=[2.2,3.8,5.5,6.5,7.0];
A=polyfit(x,y,1);
a=A(1)
b=A(2)
plot(x,y,'r*');hold on;
plot(x,a*x+b);hold off;%y=ax+b
a =
1.2300
b =
0.0800