Computer Science 106: MATLAB
HW 4, due 2/26
Please include your name in your homework
1. You can store a polynomial as a vector of the polynomial’s coefficients, for
example,
(1/8)*(35x
4
– 30 x
2
‐ 3) would be:
[ .375 0 3.75 0 4.375]
( that’s [3/8 0 30/8 0 35/8] )
Given this method of storing polynomials, write evaluatePoly(P,x),
integratePoly(P,a,b), and for extra credit multiplyPoly(P,Q),
2. Legendre polynomials
http://en.wikipedia.org/wiki/Legendre_polynomials
P
0
(x) = 1
P
1
(x) = x
P
2
(x) = (1/2)*(3x
2
– 1)
P
3
(x) = (1/2)*(5x
3
– 3x)
P
4
(x) = (1/8)*(35x
4
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '13
 P.Dobosh
 Polynomials, Coefficient, Computer Science, Legendre polynomials

Click to edit the document details