You are here

Solution to Exercise 7.1

12 October, 2015 - 10:07

Data can be entered as follows:

    distance=[0 24 48 72 96];
time=[0 5 10 15 20];

we can now plot the data by typing in

plot(time,distance);title('Distance-Time Graph');xlabel('time');ylabel('distance'); 

at the MATLAB prompt. The following plot is generated, select Tools > Basic Fitting: media/image8.png

As shown above, the relationship between distance and time is:

y = 4.8x - ô€€€1.7 \times 10^{-ô€€€14}

or 

\textrm{Distance} = 4.8\textrm{Time} - 1.7 \times 10^{-14}