Thread Subject: polyfit

Subject: polyfit

From: mona

Date: 22 Nov, 2009 11:12:00

Message: 1 of 4

Hi all
I know that I can use polyfit to fit the polynamial like
y=Ax^2+Bx+c
but waht about the polynamial which I cant saperat x and y like

Ax^2+Bxy+Cy^2+Dx+Ey+F=0

can I use polyfit to fit it ?

thanks


Mona

Subject: polyfit

From: Matt

Date: 22 Nov, 2009 14:13:04

Message: 2 of 4

"mona " <iee2006@yahoo.com> wrote in message <heb6a0$mjr$1@fred.mathworks.com>...
> Hi all
> I know that I can use polyfit to fit the polynamial like
> y=Ax^2+Bx+c
> but waht about the polynamial which I cant saperat x and y like
>
> Ax^2+Bxy+Cy^2+Dx+Ey+F=0
>
> can I use polyfit to fit it ?

No. What's often does is to use svd() to find the vector

v=[A;B;C;D;E;F]

which is approximately in the null-space of the matrix

M=[x(:).^2, x(:).*y(:), y(:).^2, x(:), y(:), ones(size(x(:)))]

Subject: polyfit

From: mona

Date: 22 Nov, 2009 16:46:02

Message: 3 of 4

"Matt " <xys@whatever.com> wrote in message <hebgtg$8b3$1@fred.mathworks.com>...
> "mona " <iee2006@yahoo.com> wrote in message <heb6a0$mjr$1@fred.mathworks.com>...
> > Hi all
> > I know that I can use polyfit to fit the polynamial like
> > y=Ax^2+Bx+c
> > but waht about the polynamial which I cant saperat x and y like
> >
> > Ax^2+Bxy+Cy^2+Dx+Ey+F=0
> >
> > can I use polyfit to fit it ?
>
> No. What's often does is to use svd() to find the vector
>
> v=[A;B;C;D;E;F]
>
> which is approximately in the null-space of the matrix
>
> M=[x(:).^2, x(:).*y(:), y(:).^2, x(:), y(:), ones(size(x(:)))]


hello all
I couden't get it; what I shoud us in svd() is it the data x,y ; could explain please
thanks
mona

Subject: polyfit

From: Matt

Date: 22 Nov, 2009 16:55:05

Message: 4 of 4

"mona " <iee2006@yahoo.com> wrote in message <hebpsa$hlk$1@fred.mathworks.com>...
> "Matt " <xys@whatever.com> wrote in message <hebgtg$8b3$1@fred.mathworks.com>...
> > "mona " <iee2006@yahoo.com> wrote in message <heb6a0$mjr$1@fred.mathworks.com>...
> > > Hi all
> > > I know that I can use polyfit to fit the polynamial like
> > > y=Ax^2+Bx+c
> > > but waht about the polynamial which I cant saperat x and y like
> > >
> > > Ax^2+Bxy+Cy^2+Dx+Ey+F=0
> > >
> > > can I use polyfit to fit it ?
> >
> > No. What's often does is to use svd() to find the vector
> >
> > v=[A;B;C;D;E;F]
> >
> > which is approximately in the null-space of the matrix
> >
> > M=[x(:).^2, x(:).*y(:), y(:).^2, x(:), y(:), ones(size(x(:)))]
>
>
> hello all
> I couden't get it; what I shoud us in svd() is it the data x,y ; could explain please
> thanks
> mona


[U,S,V]=svd(M,0);
v=V(:,end); %v=[A,B,C,D,E,F].'

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com