Is it possible to cre开发者_C百科ate a mesh plot from X, Y, and Z when X and Y do not form a grid?
The example below might answer your question
clear all
close all
xdata = [1:11];
ydata = [1:6 1:5];
zdata = rand(size(xdata));
[X,Y] = meshgrid(linspace(min(xdata),max(xdata),20), linspace(min(ydata),max(ydata),30));
Y=sort(Y,'descend');
X=sort(X,'descend');
contourdata = griddata(xdata,ydata,zdata,X,Y);
figure
%contourf(X,Y,contourdata,30,'LineColor','None');
mesh(X,Y,contourdata);
colorbar
精彩评论