Thread Subject: Plotting 3-D Surface & Surface Fitting

Subject: Plotting 3-D Surface & Surface Fitting

From: Eric

Date: 4 Dec, 2007 18:36:33

Message: 1 of 12

Does Matlab have a way to create a surface plot from a set
of 3-dimensional (empirical) data points? The data points
(x,y,z) are from a nonlinear system. Also, does Matlab have
a function(s) that can be used generate an equation from a
3D surface plot?

Thank You
Eric

Subject: Plotting 3-D Surface & Surface Fitting

From: John D'Errico

Date: 4 Dec, 2007 21:33:10

Message: 2 of 12

"Eric " <ErcFrgsn@aol.com> wrote in message
<fj46nh$cvl$1@fred.mathworks.com>...
> Does Matlab have a way to create a surface plot from a set
> of 3-dimensional (empirical) data points? The data points
> (x,y,z) are from a nonlinear system. Also, does Matlab have
> a function(s) that can be used generate an equation from a
> 3D surface plot?

If the surface can be interpreted as a single
valued function, z(x,y), then griddata or
more simply gridfit from the File Exchange
will help here.

If your data represents a closed surface, or
some general convoluted and non-functional
manifold, then no, there is no tool currently
in Matlab or on the file exchange to do this.

John

Subject: Plotting 3-D Surface & Surface Fitting

From: Bruno Luong

Date: 4 Dec, 2007 21:44:44

Message: 3 of 12

"John D'Errico" <woodchips@rochester.rr.com> wrote in or
> more simply gridfit from the File Exchange
> will help here.
>

I have take a look at gridfit the other day, it's an awsome
tool, highly recommended.

Is there any similar tool for interpolating in 3D?

Bruno

Subject: Plotting 3-D Surface & Surface Fitting

From: John D'Errico

Date: 4 Dec, 2007 22:50:21

Message: 4 of 12

"Bruno Luong" <brunoluong@yahoo.com> wrote in message
<fj4hoc$o0f$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in or
> > more simply gridfit from the File Exchange
> > will help here.
> >
>
> I have take a look at gridfit the other day, it's an awsome
> tool, highly recommended.
>
> Is there any similar tool for interpolating in 3D?
>
> Bruno

Not available in the public domain. It gets tricky,
since gridfit is a variation of a tool that I developed
almost 20 years ago. At the time, Kodak had me
gain several US patents on the methods used, AS
they are applied to color characterization
modeling. I then built nice tools for this purpose
in Matlab to solve these problems in 3d and above.
I've used those tools for up to 7-d surfaces, and
I believe them to still be in use.

When I wrote gridfit to put on the file exchange
after my retirement, I specifically chose methods
that were not covered in those patents in my
name, and I restricted it to work only in 2-d. As
such, it cannot offer any conflict.

So, no, sorry. Despite the many times that I've
been asked for a higher dimensional version, I
can't encourage anyone to potentially violate a
patent. Perhaps I can change my mind one day
in the future when those old patents are no
longer active...

John

Subject: Plotting 3-D Surface & Surface Fitting

From: Bruno Luong

Date: 5 Dec, 2007 06:30:24

Message: 5 of 12

"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <fj4ljd$n3g$1@fred.mathworks.com>...

>
> Not available in the public domain. It gets tricky,
> since gridfit is a variation of a tool that I developed
> almost 20 years ago. At the time, Kodak had me
> gain several US patents on the methods used, AS
> they are applied to color characterization
> modeling.
>
> So, no, sorry. Despite the many times that I've
> been asked for a higher dimensional version, I
> can't encourage anyone to potentially violate a
> patent. Perhaps I can change my mind one day
> in the future when those old patents are no
> longer active...
>

I believe patents expire in about 15/20 years depending on
the country.

Bruno

Subject: Plotting 3-D Surface & Surface Fitting

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 5 Dec, 2007 18:14:16

Message: 6 of 12

In article <fj5gi0$37r$1@fred.mathworks.com>,
Bruno Luong <brunoluong@yahoo.com> wrote:
>"John D'Errico" <woodchips@rochester.rr.com> wrote in
>message <fj4ljd$n3g$1@fred.mathworks.com>...
>
>>
>> Not available in the public domain. It gets tricky,
>> since gridfit is a variation of a tool that I developed
>> almost 20 years ago. At the time, Kodak had me
>> gain several US patents on the methods used,

>I believe patents expire in about 15/20 years depending on
>the country.

Some countries (including the USA) sometimes allow patents to be renewed
one or more times (not necessarily for as long each time.)
--
  "All is vanity." -- Ecclesiastes

Subject: Plotting 3-D Surface & Surface Fitting

From: John D'Errico

Date: 5 Dec, 2007 18:35:30

Message: 7 of 12

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in message
<fj6ppo$fol$1@canopus.cc.umanitoba.ca>...
> In article <fj5gi0$37r$1@fred.mathworks.com>,
> Bruno Luong <brunoluong@yahoo.com> wrote:
> >"John D'Errico" <woodchips@rochester.rr.com> wrote in
> >message <fj4ljd$n3g$1@fred.mathworks.com>...
> >
> >>
> >> Not available in the public domain. It gets tricky,
> >> since gridfit is a variation of a tool that I developed
> >> almost 20 years ago. At the time, Kodak had me
> >> gain several US patents on the methods used,
>
> >I believe patents expire in about 15/20 years depending on
> >the country.

I think it is 17 years in the US.

 
> Some countries (including the USA) sometimes allow patents to be renewed
> one or more times (not necessarily for as long each time.)

Yes. I've wondered whether Kodak will choose
to do so here. Only they know. I will check in a
year or so.

John

Subject: Plotting 3-D Surface & Surface Fitting

From: Sudha` N

Date: 4 Aug, 2008 01:49:02

Message: 8 of 12


Hi - How do you generate the equation for z=f(x,y) from a
surface fitting?
I am using gridfit and have surface fitted my data
successfully. But the key purpose of my experiment is to
generate the equation for z as a function of x and y.

Thanks.


"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <fj4h2m$ei8$1@fred.mathworks.com>...
> "Eric " <ErcFrgsn@aol.com> wrote in message
> <fj46nh$cvl$1@fred.mathworks.com>...
> > Does Matlab have a way to create a surface plot from a set
> > of 3-dimensional (empirical) data points? The data points
> > (x,y,z) are from a nonlinear system. Also, does Matlab have
> > a function(s) that can be used generate an equation from a
> > 3D surface plot?
>
> If the surface can be interpreted as a single
> valued function, z(x,y), then griddata or
> more simply gridfit from the File Exchange
> will help here.
>
> If your data represents a closed surface, or
> some general convoluted and non-functional
> manifold, then no, there is no tool currently
> in Matlab or on the file exchange to do this.
>
> John

Subject: Plotting 3-D Surface & Surface Fitting

From: John D'Errico

Date: 4 Aug, 2008 02:04:01

Message: 9 of 12

"Sudha` N" <sudhanatarajan@gmail.com> wrote in message
<g75n6e$qf0$1@fred.mathworks.com>...
>
> Hi - How do you generate the equation for z=f(x,y) from a
> surface fitting?
> I am using gridfit and have surface fitted my data
> successfully. But the key purpose of my experiment is to
> generate the equation for z as a function of x and y.

Sorry, but the surface that gridfit generates
has no simple model. There is no "equation",
besides a local, piecewise linear interpolant.
In effect, gridfit produces a variant of a low
order spline, in two dimensions.

Can you generate an equation for the surface?
Yes, you can choose to fit a model to that,
but that will require that you choose a model
form, as well as a fitting method.

If your goal was really to generate a model
expression for this surface, then gridfit was
the wrong choice for your fit. You are now
fitting a model to the approximation that
gridfit chose. So you essentially have two sets
of residuals, and two sources of lack of fit to
deal with. If your true goal was that equation,
then you should fit it to your original data.

KNOW YOUR GOALS!!! Know what it is you
need to gain from any such effort, before
you begin the process of modeling. Otherwise
you are just wasting time.

John

Subject: Plotting 3-D Surface & Surface Fitting

From: Sudha` N

Date: 4 Aug, 2008 02:36:02

Message: 10 of 12



> If your true goal was that equation,
> then you should fit it to your original data.

John - Thanks. Yes my true goal is the equation, but I
needed a nice graphical representation of my data too. Using
gridfit was very quick and easy to do it.

What is the best and fastest way to model an equation
for my data using matlab?

Please provide me some pointers and I can read up from
there.

Thanks.




"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g75o2h$oco$1@fred.mathworks.com>...
> "Sudha` N" <sudhanatarajan@gmail.com> wrote in message
> <g75n6e$qf0$1@fred.mathworks.com>...
> >
> > Hi - How do you generate the equation for z=f(x,y) from a
> > surface fitting?
> > I am using gridfit and have surface fitted my data
> > successfully. But the key purpose of my experiment is to
> > generate the equation for z as a function of x and y.
>
> Sorry, but the surface that gridfit generates
> has no simple model. There is no "equation",
> besides a local, piecewise linear interpolant.
> In effect, gridfit produces a variant of a low
> order spline, in two dimensions.
>
> Can you generate an equation for the surface?
> Yes, you can choose to fit a model to that,
> but that will require that you choose a model
> form, as well as a fitting method.
>
> If your goal was really to generate a model
> expression for this surface, then gridfit was
> the wrong choice for your fit. You are now
> fitting a model to the approximation that
> gridfit chose. So you essentially have two sets
> of residuals, and two sources of lack of fit to
> deal with. If your true goal was that equation,
> then you should fit it to your original data.
>
> KNOW YOUR GOALS!!! Know what it is you
> need to gain from any such effort, before
> you begin the process of modeling. Otherwise
> you are just wasting time.
>
> John

Subject: Plotting 3-D Surface & Surface Fitting

From: Sudha` N

Date: 4 Aug, 2008 03:40:04

Message: 11 of 12


Got my answers here:
http://www.mathworks.de/matlabcentral/newsreader/view_thread/163107

"Sudha` N" <sudhanatarajan@gmail.com> wrote in message
<g75pui$90r$1@fred.mathworks.com>...
>
>
> > If your true goal was that equation,
> > then you should fit it to your original data.
>
> John - Thanks. Yes my true goal is the equation, but I
> needed a nice graphical representation of my data too. Using
> gridfit was very quick and easy to do it.
>
> What is the best and fastest way to model an equation
> for my data using matlab?
>
> Please provide me some pointers and I can read up from
> there.
>
> Thanks.
>
>
>
>
> "John D'Errico" <woodchips@rochester.rr.com> wrote in
> message <g75o2h$oco$1@fred.mathworks.com>...
> > "Sudha` N" <sudhanatarajan@gmail.com> wrote in message
> > <g75n6e$qf0$1@fred.mathworks.com>...
> > >
> > > Hi - How do you generate the equation for z=f(x,y) from a
> > > surface fitting?
> > > I am using gridfit and have surface fitted my data
> > > successfully. But the key purpose of my experiment is to
> > > generate the equation for z as a function of x and y.
> >
> > Sorry, but the surface that gridfit generates
> > has no simple model. There is no "equation",
> > besides a local, piecewise linear interpolant.
> > In effect, gridfit produces a variant of a low
> > order spline, in two dimensions.
> >
> > Can you generate an equation for the surface?
> > Yes, you can choose to fit a model to that,
> > but that will require that you choose a model
> > form, as well as a fitting method.
> >
> > If your goal was really to generate a model
> > expression for this surface, then gridfit was
> > the wrong choice for your fit. You are now
> > fitting a model to the approximation that
> > gridfit chose. So you essentially have two sets
> > of residuals, and two sources of lack of fit to
> > deal with. If your true goal was that equation,
> > then you should fit it to your original data.
> >
> > KNOW YOUR GOALS!!! Know what it is you
> > need to gain from any such effort, before
> > you begin the process of modeling. Otherwise
> > you are just wasting time.
> >
> > John
>

Subject: Plotting 3-D Surface & Surface Fitting

From: John D'Errico

Date: 4 Aug, 2008 05:00:04

Message: 12 of 12

"Sudha` N" <sudhanatarajan@gmail.com> wrote in message
<g75pui$90r$1@fred.mathworks.com>...
>
>
> > If your true goal was that equation,
> > then you should fit it to your original data.
>
> John - Thanks. Yes my true goal is the equation, but I
> needed a nice graphical representation of my data too. Using
> gridfit was very quick and easy to do it.
>
> What is the best and fastest way to model an equation
> for my data using matlab?
>
> Please provide me some pointers and I can read up from
> there.
>
> Thanks.

The problem is, there is NO best way, nor
is there a terribly fast way that is any good.
Even in one dimension, finding the function
that generates a simple curve is a often
difficult process. It very much helps if you
have some prior knowledge as to the correct
mathematical form for your model. Without
that knowledge, it becomes a total guessing
game.

Of course, someone will probably be tempted
to suggest polynomials, as my own polyfitn
(also on the fex) can do the fitting. However,
while this is a fast solution, polynomial
models have their limits, and this does not
yield some simple relationship.

I'm sorry not to be of much help here.

John

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
equation Sudha` N 3 Aug, 2008 21:50:07
gridfit Sudha` N 3 Aug, 2008 21:50:06
generate Sudha` N 3 Aug, 2008 21:50:06
matlab Sudha` N 3 Aug, 2008 21:50:06
nonlinear modeling Eric 4 Dec, 2007 13:40:15
empirical data Eric 4 Dec, 2007 13:40:15
3d Eric 4 Dec, 2007 13:40:15
surface fitting Eric 4 Dec, 2007 13:40:15
data points Eric 4 Dec, 2007 13:40:15
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com