赤子可鉴 发表于 2009-12-20 23:30:26

请教画两个空间圆问题,敬请指教!

小弟想画两个空间的圆,编了一下简单程序,可却画不出来:'( !敬请高手指点...
clear
syms p
x=sin(p)
z=cos(p)
y=1
ezplot3(x,y,z)
hold on
x=sin(p)
z=cos(p)
y=-1
ezplot3(x,y,z)

messenger 发表于 2009-12-21 00:14:29

用plot3画吧。ezplot命令中hold on不管用。type ezplot3可以看到ezplot3中有一句figure(fig);,这句会把原来的图冲掉的。

赤子可鉴 发表于 2009-12-21 12:08:46

用plot3画吧。ezplot命令中hold on不管用。type ezplot3可以看到ezplot3中有一句figure(fig);,这句会把原来的图冲掉的。
messenger 发表于 2009-12-21 00:14 http://forum.simwe.com/images/common/back.gif
嗯,谢谢咯。我用plot3编了个小程序,画了出来。
clear
a=0:0.1:2*pi;
x=sin(a);
y=sin(a);
z=cos(a);
b=size(a);
y1=ones(1,b(2));
y2=-ones(1,b(2));
x1=ones(1,b(2));
x2=-ones(1,b(2));
plot3(x,y1,z)
hold on
plot3(x,y2,z)
hold on
plot3(x1,y,z)
hold on
plot3(x2,y,z)
页: [1]
查看完整版本: 请教画两个空间圆问题,敬请指教!