Writing systems of linear equations and matlab help appreciated

73 Views Asked by At

Does anyone know how I would go about answering the following question?

A traffic engineering company has installed some trac cameras along a one lane road to find a relation between the number of cars passing the road and the average speed at which the cars move. The cameras show that:

  • Point 1: When there is 1 car passing the road, the average speed is 50km/h.
  • Point 2: When there are 5 cars passing the road, the average speed is 45km/h.
  • Point 3: When there are 12 cars passing the road, the average speed is 38km/h.

The traffic engineering company decides to model the average speed (shown by $u$) as a linear function of the number of cars (shown by $n$). So we want to have $$u(n) = \alpha + \beta n.$$

Using Point 1 and Point 2 information, write the system of linear equations to calculate $\alpha$ and $\beta$. Write a MATLAB code to calculate $\alpha$ and $\beta$.