# How to do I this linear least- squares problem?

This is what i am given:
$y=[3, 5, 5, 8, 10, 12, 15, 16, 18, 19]$ and $t=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]$ experimental data

Solve x=A\b Thanks got it

-
Who is 'it'? Is it your homework sheet making demands on the plot-formatting? – Peter Sheldrick Nov 25 '12 at 2:03

Here set you up with the code:

y=[3, 5, 5, 8, 10, 12, 15, 16, 18, 19] t=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

A = [t',ones(10,1)]; b = y';

x=A\b

plot(t,y,'o',[1, 10], [x(1)*1+x(2), x(1)*10+x(2)],'-')

-
Thanks, so i am guessing the formulation part is A = [t',ones(10,1)]; b = y' – ASROMA Nov 25 '12 at 2:14
What is the total squared error here? – ASROMA Nov 25 '12 at 2:34