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: 2d data interpolation
Replies: 6   Last Post: Apr 24, 2013 12:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: 2d data interpolation
Posted: Nov 30, 2012 9:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"Giuseppe " <giuseppe.zito@artorg.unibe.ch> wrote in message
news:k99mt3$16l$1@newscl01ah.mathworks.com...
> Yes, sure, these are the command lines
> (cen_x is the vector with the x-coordinates, cen_y with the y-coordinates
> and in dd there are the values I want to interpolate. All of them are
> vectors with the same length)
>
> [Xi, Yi] = meshgrid(0:600);
> Zi = interp2(cen_x, cen_y, dd, Xi, Yi);
> figure, mesh(Xi, Yi, Zi);
>
> When I run these lines, I have the message:
>
> ??? Error using ==> interp2 at 180
> X and Y must be monotonic vectors or matrices produced by MESHGRID.


That's correct. The INTERP2 function interpolates a function whose values
are known on a regular grid to scattered points. If you want to interpolate
a function whose values are known at scattered points, look at GRIDDATA.

http://www.mathworks.com/help/matlab/ref/griddata.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




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.