Polyfit Question

Thomas D. Dean tomdean at speakeasy.org
Tue Feb 17 13:15:37 CST 2009


I have used polyfit() with some success.  However, I seem to have a
functionality problem in my head or something.

X=[1329, 2204, 3584];
Y=[15.75, 30, 65];
[P,S,MU]=polyfit(X,Y,2);
S.normr
  ans =  1.7405e-14
S.yf
  ans = 15.750   30.000   65.000

I expect this to be a pretty good fit

polyval(P,X)
ans =
   9.2208e+06   2.5325e+07   6.6912e+07

I expected P(X) near Y.

Y=polyval(P,X,[],MU)
Y =
   15.750   30.000   65.000

I expected to get this without using MU.

Where is my head wrong?

tomdean



More information about the Help-octave mailing list