Lab 9 covers Chapter 8 of Gilat (polynomials and curve-fitting).

advertisement
Lab 9 covers Chapter 8 of Gilat (polynomials and curve-fitting).
g5c8p287x04 (conv, polyval): Define each polynomial factor as a vector (see pp262 of Gilat), then use
the conv command repeatedly (see p265, especially 2nd note). Once you have the product, use the
polyval command to plot (explained on pp262-263 of Gilat).
g5c8p287x06 (deconv): Define your polynomials as vectors, then use the deconv command to divide
(p265-266).
g5c8p287x08 (conv, roots): Ask the students what the 3 integers are if x is the first integer (x+5,
x+10). Define the three as polynomial vectors and use conv to form the product. Then subtract 10098
from the last element (the constant) and use the roots command (pp263-264) to find the solution
(NOTE that only integer solutions are allowed).
g5c8p291x24d (polyfit, polyval): Refer to pp267-270 for an explanation of what the polyfit command
does. After using the polyval command to plot the equation (as in g5c8p286x02), hold on, then plot the
data using the plot command (pp148-149).
g5c8p293x30b (interp1): Interpolation is explained on pp274-277. Define your data, then create a
plottable vector (xi in the example on p277, though I like to call my data xdata/ydata and use x and y
for plotting), and use the "interp1" (ends with the number one) to create the y vector.
Plot the interpolation and the data points as discussed above. For the second part of the question,
replace the "xi" in the p277 example with the number 11.5 to get the specific y-value.
Download