Example:

Example 2 (Example 14.11): Curve Fitting with MATLAB. Note: Instead of entering all the x-values, since they are incremented by 0.5, you can quickly set the x-range as: x=0:0.5:3. Also have the students plot the x,y data and the polynomial curve fit on a single plot. ................
................