x=[2,2,3,4,4,5,6,7,8,9,5]';
y=[10,11,12,13,14,15,20,18,22,25,20]';
[b0,b1,rsq,StdErrEst,StdRes] = linfit(x,y);
disp([b0,b1,StdErrEst,rsq])
fit=b0+b1*x;
plot(x,fit)
hold on
plot(x,y,'*')
hold off
disp(StdRes)