Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: odd power polynomial Interpolation ////
Posted:
May 10, 2013 7:13 AM


> Hi. > > I have a vector X and it's corresponding vector Y. > Now i want to interpolate using a polynomial like > this: > Y=aX+bX^3+cX^5+... > > How can i do that? > > All answers are appreciated ...
If (x_i,y_i) (i=1,...,n) are your measurements, solve the linear system in the unknowns a,b,c,... y_i = a*x_i + b*x_i^3 + c*x_i^5 + ... (i=1,...,n) by using the \  operator.
Thus build the matrix A with row i defined as [x_i (x_i)^3 (x_i)^5 ...] and the column vector b with ith entry y_i and solve for the coefficient vector coeff as coeff=A\b. Then coeff(1)=a, coeff(2)=b, coeff(3)=c, ...
Best wishes Torsten.



