为什么plot可以,mesh却不行了呢?
请大家帮忙看看问题出在哪里?整了半天也没整明白是怎么回事,先谢了!这个可以很顺利的做出图来
k=linspace(-2,0,100);
lamda=25.6372; a=0.84; M=28.9255;
y= - (log((k+1).^2))/(lamda+0.1*M*(1-a));
figure
plot(k,y,'r');
同样的数据改用mesh对k和a作图却做不出来了
= meshgrid(0:0.01:1,-2:0.01:0);
lamda = 25.6372; M = 28.9255;
y = - (log((k+1).^2))/(lamda+0.1*M*(1-a));
mesh(a,k,y)
Warning: Log of zero.
Warning: Rank deficient, rank = 1,tol = 1.2154e-011.Warning: Matrix dimensions must agree, not rendering mesh.
Warning: Matrix dimensions must agree, not rendering mesh.
Warning: Matrix dimensions must agree, not rendering mesh.
Warning: Matrix dimensions must agree, not rendering mesh. 回复 1 # 蓝云天 的帖子
猜测LZ是要点乘!y = - (log((k+1).^2))./(lamda+0.1*M*(1-a)); ChaChing 果然厉害。我昨天已经找出问题来了,确实应该是点除。漏了一个点。唉忙活了半天。谢谢你哈
页:
[1]