当X和Y不形成网格时,是否可以从X,Y和Z创建网格图?
答案 0 :(得分:0)
以下示例可能会回答您的问题
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