Polyfit Question
Ben Abbott
bpabbott at mac.com
Tue Feb 17 13:39:55 CST 2009
On Tuesday, February 17, 2009, at 02:15PM, "Thomas D. Dean" <tomdean at speakeasy.org> wrote:
>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
Your polyfit/polyval are working as intended.
If you're confused by the description given by "help polyval" and "help polyfit", please propose a change.
Ben
More information about the Help-octave
mailing list