求助大神
matlab吧
全部回复
仅看楼主
level 2
excel导入到matlab中的数据,维数如下图所示:
画三维图的时候,老提醒The lengths of X and Y must match the size of Z.,不知道怎么解决,希望各位大神帮忙看看,谢谢!
2013年11月14日 02点11分 1
level 2
写的程序如下:
clear all
close all
clc
A=xlsread('BOOK1.xls');
N=2049;
M=51;
for i=2:N
for j=2:M
X(i,1)=A(i,1);
Y(1,j)=A(1,j);
Z(i,j)=A(i,j);
end
end
Z1=Z;
[x,y]=meshgrid(X,Y);
z=griddata(X,Y,Z,x,y);
surf(x,y,z);
shading interp;
运行以后就出现:The lengths of X and Y must match the size of Z.
2013年11月14日 02点11分 2
1