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 20:55:03 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 41
Message-ID: <gg7777$52l$1@fred.mathworks.com>
References: <gg6ovh$4db$1@fred.mathworks.com> <gg6s8i$4mr$1@fred.mathworks.com> <gg71op$4c1$1@fred.mathworks.com> <gg7322$p7o$1@fred.mathworks.com> <gg73kq$53o$1@fred.mathworks.com> <gg7679$i6v$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 1227300903 5205 172.30.248.35 (21 Nov 2008 20:55:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Nov 2008 20:55:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:502411


"loic paccard" <loic.paccard@ecam.fr> wrote in message <gg7679$i6v$1@fred.mathworks.com>...
> "Johan Carlson" <Johan.E.Carlson@gmail.com> wrote in message <gg73kq$53o$1@fred.mathworks.com>...
> 
> Your code is very great for minimizing the total sum of squared distances to my measured data but this is not really the solution to my problem..
> 
> Maybe I should explain more..
> I am working on calibrating a probe and data is taken in 169 points in a plane x by y where x is between -36 to 36 by a 6 degree step and the same for y.
> 
> By measuring data in these points, a calculation using data discrete values give me a z value for each point.
> So 169 values in my grid.
> These 169 values define my surface, there is no noise, it is a physical shape surface of the probe's sensitivity.
> The goal is to minimize this value and get the position (x,y) associated with.
> For this I can interpolate easily my data values in other points of the grid by interp2 but what I need is using fmincon for get a minimum in a optimized way.
> 
> And fmincon seems to work only with analytical expression function and not with
> evaluated values of a variable.
> 
> I know that I could use min(min(MYmatrix) but the final purpose is to get accuracy on x and y about 0.1 for a great number of samples. So a basic search like min(min(..)) will be too lomg.
> 
> So I definitively need to use a powerful minimizer like fmincon.
> 

You actually want to find a minimum point on the
surface?

Just use interp2, with one of the smooth interpolants,
not the default interpolation method which is bilinear.
Thus, use either 'cubic' or 'spline' as the method.

Then, use an optimizer, applied to the prediction
interpolated by interp2. The starting value you would
use is just the location of the minimum value at any
of the nodes in the lattice. You might want to apply
bounds to the optimizer, to keep it within the range
of the data points, so fmincon is an option, but also
my fminsearchbnd from the file exchange. You do
not need anything complicated for the optimization.

http://www.mathworks.com/matlabcentral/fileexchange/8277

John