Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: odd power polynomial Interpolation ////
Replies: 2   Last Post: May 10, 2013 1:55 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Torsten Hennig

Posts: 2,419
Registered: 12/6/04
Re: odd power polynomial Interpolation ////
Posted: May 10, 2013 7:13 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> 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 i-th 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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.