Matlab 版 (精华区)

发信人: zjliu (秋天的萝卜), 信区: Matlab
标  题: [转载]关税5
发信站: 哈工大紫丁香 (Thu Jun 12 21:19:02 2003)

pause
t=0:0.01:10*pi;
x=t.*sin(t);y=t.*cos(t);
comet3(x,y,t);

pause(2)
figure
axislimits=[min(x) max(x) min(y) max(y) min(t) max(t)];
for indexnumber=1:length(x)
    plot3(x(indexnumber),y(indexnumber),t(indexnumber),'bo');
    axis(axislimits);
    drawnow;
end

pause(2)
figure
axis(axislimits);

line_handle=line(x(1),y(1),t(1),...
    'color','c',...
    'linestyle','o');
for indexnumber=2:length(x)
    delete(line_handle);
    line_handle=line(x(indexnumber),...
        y(indexnumber),...
        t(indexnumber),...
        'color','b',...
        'linestyle','o');
    drawnow;
end

pause(2)
figure
line_handle=line(x(1),y(1),t(1),...
    'color','r',...
    'linestyle','o');
 set(line_handle,'erasemode','xor');
axis(axislimits);
for indexnumber=2:length(x)
for indexnumber=2:length(x)
    set(line_handle,'xdata',x(indexnumber),...
        'ydata',y(indexnumber),...
        'zdata',t(indexnumber));
    drawnow
end

练习
1  分析为何后面三个动画的速度会不一样,你是否遇到过同样的问题?
2  把  xor 换成 none, background, normal 分别是什么现象
   如果用background模式,最后加上 refresh

--
╔═══════════════════╗
║★★★★★友谊第一  比赛第二★★★★★║
╚═══════════════════╝

※ 来源:.哈工大紫丁香 bbs.hit.edu.cn [FROM: 202.118.229.92]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.708毫秒