Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: griddedInterpolant with three four dimensional arrays
Replies: 3   Last Post: Apr 10, 2013 3:34 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jonathan W Smith

Posts: 87
Registered: 12/17/10
Re: griddedInterpolant with three four dimensional arrays
Posted: Apr 10, 2013 2:24 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Steven_Lord" <slord@mathworks.com> wrote in message <kk46sj$am9$1@newscl01ah.mathworks.com>...
>
>
> "Jonathan W Smith" <jwsmith9@gmail.com> wrote in message
> news:kk43fn$t7s$1@newscl01ah.mathworks.com...

> > Hello
> >
> > The p here stands for pressure.
> > Array p_1 has dimension has south-north, west-east, vertical, and time
> > dimensions.
> >
> > p_2 has the same dimensions and is the same size as p_2 but has a
> > different set of pressure data.
> > I want to find the pressure levels of p_1 in the p_2 array because I have
> > another array that contains ozone (I'll call this array o3). The ozone
> > data corresponds with p_1.

>
> What specifically are the SIZEs of p_1, p_2, and o3?
>

> > I tried the following,
> >
> > new_p = griddedInterpolant(p_2, p_1, o3);

>
> Okay, that will work if p_2, p_1, and o3 are matrices of the same size. If
> p_2 and p_1 are vectors and o3 is a matrix the same size as the matrices you
> receive as output from an NDGRID call with p_2 and p_1 as input then you
> need to call griddedInterpolant differently.
>
> new_p = griddedInterpolant({p_2, p_1}, o3);
>
> Compare:
>
> oneten = 1:10;
> [X,Y] = ndgrid(oneten, oneten);
> V = X.^2 + Y.^2;
> F = griddedInterpolant(X,Y,V,'cubic');
> F2 = griddedInterpolant({oneten, oneten},V,'cubic');
>
> See the third, fourth, and fifth items under Input Arguments on the page to
> which you linked.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com




Steve: Thanks for your response.

Each array is 41, 71, 8 (each array the same size). I should also clarify that each array is a 3-dimensional array and not 4.

However when I try, new_p = griddedInterpolant(p_2, p_1, o3);

I get this error:
Error using griddedInterpolant The nubmer of input coordinate arrays does not equal the number of dimensions (NDIMS) of these arrays.

What am I missing?
Jonathan



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.