Re: plotting polyfit



Hi Steve, Thanks for your reply!

I tried both "format long" as well as "y = p(1)*x.^4 + p(2)*x.^3 ..."
as you suggested... but still, the same, consistent wrong plot.
You're right in that the portions of the coefficients matter... my
desired plot should have a y-axis range from 1 to 4 with a decreasing
sloped curve, but in the undesired plot, the y-axis ranges from 0 to
1e38!!!! AND the curve is INCREASING almost exponentially!

sigh... please let me know if you or anyone else has any
suggestions!! I will be more than happy to send my code if this
sounds too confusing... Thanks again for your input!

-: Madiha :-

Steven Lord wrote:
>> 0.0145 -0.0211 -0.0005 -0.0493 2.7644
>
> Those aren't the coefficients from p. Those are how the
> coefficients from p
> were displayed in FORMAT SHORT, which is the default display
> format. Try
> using FORMAT LONG G or, better yet, define:
>
> y = p(1)*x.^4 + p(2)*x.^3 ...
>
> and see if that looks closer to the results from POLYVAL. The
> portions of
> the coefficients that you don't see with FORMAT SHORT are very
> small, but
> when you're multiplying the coefficient of the quartic term by
> something on
> the order of 2.7e42 [(4.05e10)^4]... those missing parts make a
> difference.
>
> --
> Steve Lord
> slord@xxxxxxxxxxxxx
.



Relevant Pages

  • RE: How do I adjust a curve ?
    ... I do the change in the format on the displayed equation and you have reason. ... polynomial coefficients are from LINESTin Excel versions prior to 2003. ... The plot of the experimental data is like the nromal distribution, ...
    (microsoft.public.excel.charting)
  • Re: plotting polyfit
    ... Now I have been trying to plot the poly-line ... > The above code plots the polyfit line beautifully over my real data; ... Those aren't the coefficients from p. ... were displayed in FORMAT SHORT, which is the default display format. ...
    (comp.soft-sys.matlab)
  • Re: Help a non-mathematicin with mathematical function
    ... > so if the data fits a*x+b very well we can fit it with any higher term very ... > well with negliable coefficients of high order. ... > The alternating coefficents are just the way the polynomails work. ... Not plot the data terms, plot the coefficients of the fit. ...
    (sci.math)
  • Help with VPA, digits and precision in a variable ...
    ... among the coefficients are giantic in some cases, therefore, ... which is not able to plot. ... then it again reduced the digits of the number to defaults ... format (if i use format long reduces to 15 and otherwise to ...
    (comp.soft-sys.matlab)
  • Re: ECG parameter Extraction using wavelets
    ... Are you asking how you plot them on the same graph as your original waveform with the correct spacing? ... note how you can isolate the discontinuity in freqbrk by overlaying the projection obtained with the level-1 detail coefficients. ... You have to keep in mind that this is an approximation and the accuracy of this approximation is heavily dependent on the wavelet used. ...
    (comp.soft-sys.matlab)