User Tools

Site Tools


gibson:teaching:fall-2012:math445:lab9

Math 445 Lab 9: log-linear relationships

For each of the following data sets, determine a function y(x) that fits the data, by the following steps

  1. Cut & paste the data set to a text file named data1.asc etc.
  2. Load the dataset to Matlab with load data1.asc.
  3. Set x to the first column of data1, y to the second.
  4. Experiment with plot, semilogy, semilogx, and loglog to determine the form of log-linear relationship x and y.
  5. Estimate the constants in the log-linear relationship graphically to determine y as a function of x, e.g. y = 3.2 x - 4.
  6. Plot the estimated function and the data together, and fine-tune your function by adjusting the constants until there is a good fit between the function and the data.

Once you have good fit between the data and the function, make a plot that shows

  • the data set's y versus x as red circles
  • your function y(x) as a solid blue line
  • a legend indicating the meaning of each plotting symbol
  • appropriate labels for each axis and a title

The data sets are given as N x 2 matrices with x as the first column and y as the second.

data set 1

-7.3678e+01   5.5580e+01
-3.9780e+01   3.8902e+01
-5.7090e+00   2.2139e+01
 7.2455e+00   1.5765e+01
 2.1237e+01   8.8812e+00
 5.3694e+01  -7.0872e+00
 6.1294e+01  -1.0827e+01
 6.6552e+01  -1.3414e+01
 7.0465e+01  -1.5339e+01
 9.8648e+01  -2.9205e+01

data set 2

1.3880e+00  -1.6169e+01
1.6134e+00  -1.4893e+01
3.0034e+00  -9.6227e+00
1.2373e+01   2.3840e+00
1.9897e+01   6.4134e+00
3.7767e+01   1.1848e+01
8.2823e+01   1.8508e+01
6.4551e+02   3.5922e+01
7.3920e+02   3.7072e+01
2.1998e+03   4.6321e+01

data set 3

-1.8137e+01   2.3293e+04
-4.9006e+00   1.7647e+03
 1.5501e+00   5.0186e+02
 1.0603e+01   8.5938e+01
 1.1370e+01   7.4004e+01
 1.2914e+01   5.4770e+01
 3.5890e+01   6.2153e-01
 4.6459e+01   7.9200e-02
 5.6213e+01   1.1830e-02
 5.6826e+01   1.0497e-02

data set 4

1.1028e+00   3.5676e-03
1.7049e+00   5.1446e-03
5.3239e+00   1.3392e-02
6.2795e+00   1.5384e-02
1.2042e+01   2.6588e-02
7.3213e+01   1.2114e-01
1.0667e+02   1.6620e-01
3.2404e+02   4.2274e-01
4.2700e+02   5.3303e-01
6.9222e+02   7.9991e-01
gibson/teaching/fall-2012/math445/lab9.txt · Last modified: 2012/11/07 20:21 by gibson