MATLAB Homework 1:

Due 22/11/2000

1. We make 10 observations at equally spaced time instants
t1=1, t2 =2, ..., t10 = 10, and the observations are equal to
bi = 2 ti + 3 + randn(1), for i= 1,...,10.
Find the least squares optimal straight line fit b = C + Dt.

2. Repeat Problem 1 with
bi = 2 ti + 3 + i*randn(1)/5.5, for i= 1,...,10.
and the least squares optimal straight line fit b = C + Dt.

3. Repeat Problem 1 with
ti = i + (rand(1)-0.5)/2
bi = 2 i + 3 + randn(1), for i= 1,...,10..
and the least squares optimal straight line fit b = C + Dt.

4. Now repeat the first three steps 100 times, possibly using "for j = 1:100".
Compute the average values of C and D for Problem 1, 2 and 3.
Comment on the results.