http://www.mathworks.com/matlabcentral/newsreader/view_thread/327709
MATLAB Central Newsreader  interopolation with method log, ln, or exp(x)
Feed for thread: interopolation with method log, ln, or exp(x)
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Wed, 20 Mar 2013 15:58:16 +0000
interopolation with method log, ln, or exp(x)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/327709#900485
Jonathan W Smith
Hello<br>
I have 3D gas constituent data from a model. The gas constituent data is on pressure levels. The pressure is on the 3D grid as well. Pressure falls exponentially with height. However I want to interpolate based on a different set of 3D pressure levels from satellite data. <br>
<br>
Is it best to use interp2 or interp3? Just as there is method 'linear' or 'cubic', is there one for ln (natural log) or exponential decay? If not, what function or set of functions can I use to substitute for this? <br>
<br>
Thanks<br>
Jonathan

Wed, 20 Mar 2013 18:06:30 +0000
Re: interopolation with method log, ln, or exp(x)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/327709#900497
someone
"Jonathan W Smith" wrote in message <kicmao$ek3$1@newscl01ah.mathworks.com>...<br>
> Hello<br>
> I have 3D gas constituent data from a model. The gas constituent data is on pressure levels. The pressure is on the 3D grid as well. Pressure falls exponentially with height. However I want to interpolate based on a different set of 3D pressure levels from satellite data. <br>
> <br>
> Is it best to use interp2 or interp3? Just as there is method 'linear' or 'cubic', is there one for ln (natural log) or exponential decay? If not, what function or set of functions can I use to substitute for this? <br>
<br>
If I understand your question, I don't believe there is a "best" answer.<br>
It really depends on your data and what you want to do with it.<br>
<br>
If x is a vector, y = exp(x), and you want to interpolate y (by any method) then you could do either:<br>
<br>
z = interp(y)<br>
<br>
or<br>
<br>
z = exp(interp(x))<br>
<br>
Its really YOUR choice.<br>
> <br>
> Thanks<br>
> Jonathan

Thu, 04 Apr 2013 16:39:18 +0000
Re: interopolation with method log, ln, or exp(x)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/327709#901530
Jonathan W Smith
"someone" wrote in message <kictr5$ajb$1@newscl01ah.mathworks.com>...<br>
> "Jonathan W Smith" wrote in message <kicmao$ek3$1@newscl01ah.mathworks.com>...<br>
> > Hello<br>
> > I have 3D gas constituent data from a model. The gas constituent data is on pressure levels. The pressure is on the 3D grid as well. Pressure falls exponentially with height. However I want to interpolate based on a different set of 3D pressure levels from satellite data. <br>
> > <br>
> > Is it best to use interp2 or interp3? Just as there is method 'linear' or 'cubic', is there one for ln (natural log) or exponential decay? If not, what function or set of functions can I use to substitute for this? <br>
> <br>
> If I understand your question, I don't believe there is a "best" answer.<br>
> It really depends on your data and what you want to do with it.<br>
> <br>
> If x is a vector, y = exp(x), and you want to interpolate y (by any method) then you could do either:<br>
> <br>
> z = interp(y)<br>
> <br>
> or<br>
> <br>
> z = exp(interp(x))<br>
> <br>
> Its really YOUR choice.<br>
> > <br>
<br>
<br>
<br>
Thanks for your response, but still what if you have an 3D array and you wanted to interpolate along the 3rd dimension? Just like we have the choice of implementing method 'linear' and 'cubic', is there one for exponential?<br>
<br>
> > Thanks<br>
> > Jonathan

Thu, 04 Apr 2013 19:51:06 +0000
Re: interopolation with method log, ln, or exp(x)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/327709#901552
someone
ime"Jonathan W Smith" wrote in message <kjkabm$b68$1@newscl01ah.mathworks.com>...<br>
> "someone" wrote in message <kictr5$ajb$1@newscl01ah.mathworks.com>...<br>
> > "Jonathan W Smith" wrote in message <kicmao$ek3$1@newscl01ah.mathworks.com>...<br>
> > > Hello<br>
> > > I have 3D gas constituent data from a model. The gas constituent data is on pressure levels. The pressure is on the 3D grid as well. Pressure falls exponentially with height. However I want to interpolate based on a different set of 3D pressure levels from satellite data. <br>
> > > <br>
> > > Is it best to use interp2 or interp3? Just as there is method 'linear' or 'cubic', is there one for ln (natural log) or exponential decay? If not, what function or set of functions can I use to substitute for this? <br>
> > <br>
> > If I understand your question, I don't believe there is a "best" answer.<br>
> > It really depends on your data and what you want to do with it.<br>
> > <br>
> > If x is a vector, y = exp(x), and you want to interpolate y (by any method) then you could do either:<br>
> > <br>
> > z = interp(y)<br>
> > <br>
> > or<br>
> > <br>
> > z = exp(interp(x))<br>
> > <br>
> > Its really YOUR choice.<br>
> > > <br>
> <br>
> <br>
> <br>
> Thanks for your response, but still what if you have an 3D array and you wanted to interpolate along the 3rd dimension? Just like we have the choice of implementing method 'linear' and 'cubic', is there one for exponential?<br>
> <br>
> > > Thanks<br>
> > > Jonathan<br>
<br>
I'm still not sure what you mean by "The pressure is on the 3D grid as well." But I'll take a stab at it. The short answer might be to look at the MathWorks Curve Fitting Toolbox. I am supposing you have collected some gas data where:<br>
<br>
g = f(x,y,h)<br>
<br>
and you know g varies linearly with x&y but decays exponentialy with h. Now you want to find g for some x1,y1,h1. I would define a new function gprime where:<br>
<br>
gprime = f(x,y,ln(h))<br>
<br>
Now linearly interpolate gprime (using interp2 or interp3) so that:<br>
<br>
gprime1 = f(x1,y1,ln(h1))<br>
<br>
this shoud give you g at x1,y1,h1.