Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com> wrote in message <gg4jfb$9qa$2@fred.mathworks.com>...
> Judy wrote:
> > Polyfit has given me a warning message saying:
> > Warning: Polynomial is badly conditioned. Remove repeated data points
> > or try centering and scaling as described in HELP POLYFIT.
>
> >> help polyfit
> POLYFIT Fit polynomial to data.
> [snip]
> [P,S,MU] = POLYFIT(X,Y,N) finds the coefficients of a polynomial in
> XHAT = (XMU(1))/MU(2) where MU(1) = MEAN(X) and MU(2) = STD(X). This
> centering and scaling transformation improves the numerical properties
> of both the polynomial and the fitting algorithm.
>
> and then
>
> >> help polyval
> POLYVAL Evaluate polynomial.
> [snip]
> Y = POLYVAL(P,X,[],MU) or [Y,DELTA] = POLYVAL(P,X,S,MU) uses XHAT =
> (XMU(1))/MU(2) in place of X. The centering and scaling parameters MU
> are optional output computed by POLYFIT.
>
> You are most likely fitting a polynomial that is of a high degree, and your x values are things like year numbers.
>
> Hope this helps.
Thanks for the reply! It is true, it is fitting a polynomial of a high degree.. It doesn't look like I can do much for the indices of x.... . . . Would anyone recommend ignoring the warnings in this situation? Or is it telling me something here....
