Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: determining the equation of a 3-D surface
Date: Fri, 21 Nov 2008 20:07:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 40
Message-ID: <gg74d6$hqs$1@fred.mathworks.com>
References: <gg6ovh$4db$1@fred.mathworks.com> <gg730g$ofn$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227298022 18268 172.30.248.35 (21 Nov 2008 20:07:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Nov 2008 20:07:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1611585
Xref: news.mathworks.com comp.soft-sys.matlab:502399


"John D'Errico" <woodchips@rochester.rr.com> wrote in message <gg730g$ofn$1@fred.mathworks.com>...
> There is no magic solution that will give you an equation
> from data points. Not fmincon, not griddata, nor my own
> gridfit.
> 
> The fact is, there are an infinite (I won't hazard a guess at
> the order of the infinity) number of ways to model any set
> of points. The splines produced by some tools (griddata
> is one version of what might call a low order spline) will
> give you an interpolant, but they do not give you a function
> in any usable form that you can write down easily.
> 
> In order to realize a usable model, you need to invest some
> time and effort of your own. (As with almost anything, you
> get what you pay for.) You need to postulate a viable model
> for the process, then you can try to estimate the parameters
> of that model from the data. Without that model, you are
> left with little more than something simple, like a polynomial
> model. My polyfitn can build such a model, but even there
> you must tell it the order of the model or the specific terms
> to be used.
> 
> http://www.mathworks.com/matlabcentral/fileexchange/10065
> 
> HTH,
> John


Thank you John for your realistic message.
To be honest I was expecting that I was actually impossible to get a 3-D analytical expression from data without knowing some hypothesis about this hypothetic equation.
And that is my case, I have no model of this curve, I am just trying to minimize (by fmincon) the z value of it in order to get the x and y positions.

But assuming that my function could be approximate by a polynomial analytical expression...

We both know that we can use polyfit for a row or column vector.
Is there a function in matlab able to do it for a matrix?
is your polyfit function able to give me an approximated analytical expression if I can guess the polynom order that I need to use??