EDUğ A = [1 0;1 1;1 2] A = 1 0 1 1 1 2 EDUğ b = [6 0 0]' b = 6 0 0 EDUğ A' ans = 1 1 1 0 1 2 EDUğ A'*A\A'*b ans = 5.0000 -3.0000 EDUğ cd a:\Tcodes % change working directory to a subdirectory a:\Tcodes EDUğ help linefit % on-line help for fitting a straight line linefit Plot the least squares fit by a line. linefit(t, b), where t and b are vectors of the same length, displays the best line fit to the data points (t(i), b(i)). EDUğ t=[0 1 2] %Example 1 of page 184 t = 0 1 2 EDUğ b=[6 0 0] b = 6 0 0 EDUğ linefit(t,b)