I have a set of data as attached. but when I surf them after using griddata. the result is deformed surf AS SHOWN IN THE PICTURE with red squares. Z values on the surf were supposed to follow the edges of the shape. I think its because there is something wrong with (z_surf) matrix in my code. But I don't know how to solve it.
Hope you can help me to solve this problem.
Thank you.
x_limit=xyz_board_ordered_dvd(:,1); y_limit=xyz_board_ordered_dvd(:,2); z_limit=xyz_board_ordered_dvd(:,3); dx=1; dy=1;x_edge=floor(min(x_limit)):dx:ceil(max(x_limit));y_edge=floor(min(y_limit)):dy:ceil(max(y_limit));[x_surf,y_surf]=meshgrid(x_edge,y_edge);z_surf=griddata(x_limit,y_limit,z_limit,x_surf,y_surf);surf(x_surf,y_surf,z_surf)xlabel('X')ylabel('Y')xlim([0 120])ylim([0 120])
Best Answer