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: Polyfit data
Replies: 1   Last Post: Feb 23, 2013 9:01 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
dpb

Posts: 6,677
Registered: 6/7/07
Re: Polyfit data
Posted: Feb 23, 2013 9:01 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/23/2013 1:42 PM, Ryan Pelky wrote:
> I have a set of data which is 19 rows by 2 columns. I'm trying to run a
> for loop to plot polyfit lines of different orders (1:7) here is what I
> came up with.
> %polyfit problem
> clear;clc;
> load('dota.mat')
>
> x=1:.01:20;
> for(i=1:7)
> coef=polyfit(dota(:,1),dota(:,2),i)


> yfit=coef(i+1)+coef(i)*x.^i;
...

A seventh order polynomial is likely to be highly noisy for real data
but above may be only for tutorial purposes...

They're aren't enough coefficients for a fixed evaluation as above and
you'll have wiped out the coef() array w/ a new order the second and
subsequent times thru, anyway...

doc polyval

--




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

[Privacy Policy] [Terms of Use]

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