Skip to main content
Logo image

Section 10.4 Practice Your Curve Fitting

Activity 10.1.

A set of seven points is given by:
\((0.9, 0.9), (1.5, 1.5), (3, 2.5), (4, 5.1), (6, 4.5), (8, 4.9), (9.5, 6.3)\text{.}\)
Fit a polynomial of degree 3 to this data and plot this polynomial along with the seven points.
Challenge: Create six plots in one figure (use subplots) like the one above, but fitting polynomials of degrees 1, 2, 3, 4, 5, and 6 to the data.
Please put your MATLAB code into the textbox.

Activity 10.2.

Given the previous data, use interpolation to approximate the y-value when \(x = 5\) using:
  1. nearest
  2. linear
  3. spline interpolation
Please put your MATLAB code into the textbook.