Excercises 3

Interpolation

Tables

1. Make a table called DataA, that has as its elements ((Subscript[x, i]),  (Subscript[y, i])) the following table
	(Subscript[x, i])	(Subscript[y, i])
	1	4.0
	3	2.8
	4	2.5
	5	3.2
	6	3.9
	10	5.0
	
2. Make a table called DataB that has as its elements ((Subscript[x, i]),  ((Subscript[x, i])^2) + 10 (Subscript[x, i]) + 1), where (Subscript[x, i]) = 0, 1, 2,  ... , 5

3. Read a table from file "data.dat" and assign it to DataC.

3. Plot the tables DataA, DataB, and DataC

4. Add to the start of the table DataA the element (0, 6.0).

5. Add to the end of DataB the element (6,  0.0).

6. Insert to the third element of DataA the element (2,  3.4).

Solution

DataA = {{1, 4.0}, {3, 2.8}, {4, 2.5}, {5, 3.2}, {6, 
          3.9}}
DataB = 
      Table[{x, (x^2) + 10  x + 1}, {x, 0, 5}]
DataC = 
      ReadList["C://data.dat", {Number, 
          Number}]
ListPlot[DataA]
ListPlot[DataB]
ListPlot[DataC]
Prepend[DataA, {0, 6.0}]
Append[DataB, {6.0, 0.0}]
Insert[DataA, {2, 3.4}, 3]

The rest is postponed to next week!