Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: determining the equation of a 3-D surface
Date: Fri, 21 Nov 2008 19:43:12 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 44
Message-ID: <gg730g$ofn$1@fred.mathworks.com>
References: <gg6ovh$4db$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
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 1227296592 25079 172.30.248.35 (21 Nov 2008 19:43:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Nov 2008 19:43:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:502393


"loic paccard" <loic.paccard@ecam.fr> wrote in message <gg6ovh$4db$1@fred.mathworks.com>...
> Hi everybody,
> 
> I collect some data in this way:
> 13 positions x (discrete points: values from -36 to 36 by a 6 step)
> 13 positions y (discrete points: values from -36 to 36 by a 6 step)
> basically it is a grid of 169 points
> And each point has a z-value that I am trying to minimize.
> 
> I can plot a surface z=f(x,y) but I need to minimize it for several samples.
> So the best minimizer would be fmincon in my case but how I can get an equation z=f(x,y) from 169 discrete points??
> 
> I want to say that using griddata is helpless in my case, I do not need to interpolate but to be able to use fmincon for my discrete values.
> 
> I have looked for hours and it does not seem like fmincon can use directly elements values in matrix referenced by row and column as a function AND there is no function able to get a 3-D equation in my case.
> 
> I will be glad to receive some help,
> loic.

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