Path: news.mathworks.com!newsfeed.mathworks.com!arclight.uoregon.edu!news-ext.gatech.edu!news-int.gatech.edu!not-for-mail
From: "Teddy Hsung" <gtg101p@mail.gatech.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Curve fitting a 3D data set
Date: Fri, 19 Nov 2004 11:13:50 -0500
Organization: Georgia Institute of Technology
Lines: 84
Sender: gtg101p@130.207.78.73
Message-ID: <cnl63d$bbt$1@news-int2.gatech.edu>
References: <eef3579.-1@webx.raydaftYaTP> <cnjb5n$guv$1@news-int2.gatech.edu> <eef3579.2@webx.raydaftYaTP> <cnl2d2$cd5$1@fb04373.mathematik.tu-darmstadt.de>
NNTP-Posting-Host: 130.207.78.73
X-Trace: news-int2.gatech.edu 1100880813 11645 130.207.78.73 (19 Nov 2004 16:13:33 GMT)
X-Complaints-To: usenet@news-int2.gatech.edu
NNTP-Posting-Date: Fri, 19 Nov 2004 16:13:33 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: news.mathworks.com comp.soft-sys.matlab:243061



I guess his problem can be formulated like this:

z1 = f(x1, y1, p1,p2...)
z2 = f(x2, y2, p1,p2...)
.
.
.
zn = f(xn, yn, p1,p2...)

where f is a known form of function. p1,p2... are the parameters that he 
wants to estimate.

\ (slash) function probably won't work because his function is highly 
possible a nonlinear function.

p=LSQCURVEFIT(f,p0,XYDATA,ZDATA) should be able to solve this problem.

where, p is a vector [p1, p2..]', p0 is initial guess of p.

XYDATA is a matrix [x1,y1
                    x2,y2
                    .....
                    xn,yn]

ZDATA is a vector  [z1, z2...zn]'

Please let us know how it works

Rentian


"Peter Spellucci" <spellucci@fb04373.mathematik.tu-darmstadt.de> wrote in 
message news:cnl2d2$cd5$1@fb04373.mathematik.tu-darmstadt.de...
>
> In article <eef3579.2@webx.raydaftYaTP>,
> Sanne <sc_trold@hotmail.com> writes:
> >That is exactly what I am trying to do. My data should fit to
> >something like a poly of second order (parabola) and I could only
> >find functions (polyfit) which could do it in 2D
> >
> >Teddy Hsung wrote:
> >>
> >>
> >> My understanding to you question is that you have a known form of
> >> function
> >> with some unknown parameters. And you have bunch of 3D data. You
> >> want to fit
> >> those data to get the parameters??
> >>
> >> If so, the optimization toolbox can help you out. If you can
> >> provide more
> >> details, I would be happy to give it a try.
> >>
> >> Rentian
> >>
> >> "Sanne Christensen" <sc_trold@hotmail.com> wrote in message
> >> news:eef3579.-1@webx.raydaftYaTP...
> >>> I'm pretty new in the Matlab-world. How do I make curve fitting
> >> on a
> >>> 3D data set (x, y, z)? Do I need a special toolbox for it?
> >>>
>  >>> Thanx for your help :)
> >>> Sanne
> >>
> >>
> >>
>
> as long as only a polynomial model is to used, \ alone will do the job for 
> you
> otherwise you will need lsqcurvefit from the optimization toolbox.
> but ... (x,y,z) -data: and "curvefitting"  you mean indeed a curve?
> not a surface? and then: which model do you have for that curve?
> parametric : (a+b*t+c*t^2 ; d+e*t+f*t^2; g+h*t+i*t^2)  with
> t the curve parameter (how to get this?) or implicit:
> (intersection of two surfaces)
> a(i)+b(i)*x+c(i)*y+d(i)*x^2+e(i)*x*y+f(i)*y^2=0  i=1,2
> plus some normalization constraints?
> hth
> peter
>
>
>