求助,为什么我hold on了,只能画出来最后一幅?下为代码,谢谢
clc;clear;
syms v11 v12 v13 v14 v21 v22 v23 v24 v31 v32 v33 v34 v41 v42 v43 k1 k2 k3 k4 k0 x y1 y2 y3 y4 y5 xk r1 r2 r3 r4 s
x=0.7;
s=0.01;
k=0.5;
r1=0.5;
r2=0.5;
r3=0.5;
y1=1+r1*s;
y2=1+r2*s;
y3=1+r3*s;
y4=1+r4*s;
y5=1+s*(k*r2+(1-k)*r4);
k0=-x^2;
k1=1-x^2;
k2=2-x^2;
k3=3-x^2;
k4=4-x^2;
v11=(k2/k4)*((2*k2*k4*y1+x*k4*y2-(2*k2^2+k0)*y3+x*k2*y4)/(4*k2^2+k0))^2;
v12=(k2/k4)*((2*k2*k4*y2+x*k4*y1-(2*k2^2+k0)*y4+x*k2*y3)/(4*k2^2+k0))^2;
v13=((-k4*(2*k2^2+k0)*y1+x*k2*k4*y2+2*(k2^3+4*k2^2+k0)*y3+x*k2^2*y4)/((4*k2^2+k0)*k4))^2;
v14=((-k4*(2*k2^2+k0)*y2+x*k2*k4*y1+2*(k2^3+4*k2^2+k0)*y4+x*k2^2*y3)/((4*k2^2+k0)*k4))^2;
v21=((k2*y1+x*y2-k1*y3)/(2*k1))*((k4*y1-k2*y2+x*y4)/(2*k4));
v22=((k2*y2+x*y1-k1*y4)/(2*k1))*((k4*y2-k2*y1+x*y3)/(2*k4));
v23=((-k4*y1+(4+k2)*y3+x*y4)/(2*k4))^2;
v24=((-k4*y2+(4+k2)*y4+x*y3)/(2*k4))^2;
v31=1/2*((4*y1+2*x*y2-2*y3-x*y4)/k4)^2;
v32=1/2*((4*y2+2*x*y1-2*y4-x*y3)/k4)^2;
v33=((-2*k2*y1+2*x*y2+2*k3*y3-x*y4)/(2*k4))*((-4*k1*y1-2*x*k1*y2+3*k2*y3+x*(k1+k4)*y4)/(2*k1*k4));
v34=((-2*k2*y2+2*x*y1+2*k3*y4-x*y3)/(2*k4))*((-4*k1*y2-2*x*k1*y1+3*k2*y4+x*(k1+k4)*y3)/(2*k1*k4));
v41=(k2/k4)*((k4*y1-k2*y3+x*y5)/(2*k2))^2+(k4*y1-k2*y3+x*y5)/(2*k2)*y1*((1-x)/(2*k2));
v42=((-k4*y1+(4+k2)*y3+x*y5)/(2*k4))^2+((-k4*y1+(4+k2)*y3+x*y5)/(2*k4))*((3-x)*y1-2*y3)/2;
v43=((x*k4*y1+x*k2*y3+(3*k3-1)*y5)/(2*k2*k4))^2;
ezplot(v11,[-1,1]);
hold on;
ezplot(v21,[-1,1]);
hold on;
ezplot(v31,[-1,1]);
hold on;
ezplot(v41,[-1,1]);
hold on; 应该加figure命令如下:
figure(1)
ezplot(v11,[-1,1]);
hold on;
ezplot(v21,[-1,1]);
hold on;
ezplot(v31,[-1,1]);
hold on;
ezplot(v41,[-1,1]);
hold on; 回复 2 # spriner 的帖子
貌似不行,还是很感谢您 般若沁 发表于 2012-5-28 19:45 static/image/common/back.gif
clc;
clear;
syms v11 v12 v13 v14 v21 v22 v23 v24 v31 v32 v33 v34 v41 v42 v43 k1 k2 k3 k4 k0 x y1 y ...
有些好奇, 利用假日有空设断点研究下!
感觉虽说easy plot, 但其程序还顶繁杂的(最少对我而言)
LZ的这个现象, 问题出在四个图的y轴范围差距很大
也不知道算不算matlab的小bug, 但个人以为至少算未考虑详尽(R2009a)
解决这个问题最简单的方式, 即在最后加上axis auto即可 回复 4 # ChaChing 的帖子
嗯嗯 谢谢,非常感谢
页:
[1]