"Giuseppe " <firstname.lastname@example.org> wrote in message news:email@example.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.