Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|cite|improve this question
    
Who is 'it'? Is it your homework sheet making demands on the plot-formatting? – Peter Sheldrick Nov 25 '12 at 2:03
up vote 1 down vote accepted

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)],'-')

share|cite|improve this answer
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.