I have x and y coordinates (first and second column of matrix x,y) and have values of function at x,y coordinates (vector z). I have prepared data for surface plot:

[X,Y]=meshgrid(geom(:,1),geom(:,2));

Z=griddata(geom(:,1),geom(:,2),z,X,Y,'linear');

surf(X,Y,Z);

I got surface as I expected except there is another surface above the surface I want (see picture).

Can someone explain to me what am I doing wrong and how to get only the surface I want?

Thanks.

Similar questions and discussions