标题: 求大神的指导,关于Z must be a matrix, not a scalar or vector. [打印本页] 作者: 半日妖 时间: 2012-5-21 09:49 标题: 求大神的指导,关于Z must be a matrix, not a scalar or vector. x=0:0.001:3;
y=0:0.02666:8;
n=length(x);
[x,y]=meshgrid(x,y);
for i=1:n;
da=0.00039654;
a=0.38:da:1.57;
a1=cosh(11+0.25.*x(i).*sin(a)).*sin(a);
A1(i)=sum(a1(1:length(a)-1)).*da;
z=886628.08.*x(i).*sin(0.125.*y(i)).*A1(i)./cosh(11);
end
mesh(x,y,z)
??? Error using ==> mesh at 73
Z must be a matrix, not a scalar or vector.
这样的东西……然后就Z必须是矩阵了……于是,改过用plot3,就变成Vectors must be the same lengths.了……求解决方案……作者: 吴建宏 时间: 2012-5-21 12:58
x=0:0.001:3;
y=0:0.02666:8;
[X,Y]=meshgrid(x,y);
z=886628.08.*X.*sin(0.125*Y)/cosh(11);
mesh(z)