数学建模社区-数学中国
标题:
自编的小程序
[打印本页]
作者:
chenhan
时间:
2011-3-4 07:36
标题:
自编的小程序
clc;clear;clf;
3 P, {6 {; p' y$ q; P2 K
t=0:0.5:4*pi;
; R: j, |/ e* F
[t,x]=meshgrid(t);
2 N5 Y/ ^) ^$ f! @
t1=timer('Period',1.0,'Executionmode','fixedrate','StartDelay',0.5);
( ?% e, o1 ~: G* C! |, g
set(t1,'TimerFcn',['current_t=datestr(clock,''mmm.dd,yyyy HH:MM:SS'');',...
9 i/ H: x- D2 `0 H+ W3 _ o0 K4 T
'title(current_t,''edgecolor'',''red'',''backgroundcolor'',[0.9,0.1,0.5],''fontsize'',16)']);
4 Q7 b7 \+ i+ E; M- P! @
start(t1);
( R- C) j; ]4 S. C
h=plot3(0,0,0,'marker','D','markersize',15);axis off
" y4 {, S7 w* c7 s
c=reshape(t,1,numel(t));
# f) B5 c0 @. s( {0 A* M6 B$ F3 C
d=reshape(x,1,numel(t));
- u+ q) l$ T$ J$ v$ Z) |- n9 {. w
for i=1:numel(t)
' l) j/ n0 G) u1 j1 Q6 ~- V7 u# A
y(i)=exp(-0.2*c(i)).*sin(pi/24*c(i)-d(i));
) n$ E% h0 j5 c3 I, F
set(h,'xdata',c(i),'ydata',d(i),'zdata',y(i));
( z: J% S2 a3 Y' ^. k1 B
if i==1
! D2 B: l& d2 P3 M; ~6 e
line(c(i),d(i),y(i),'color',[0.5 0.5 0.5]);
6 Z3 L2 u9 |0 V: t3 g2 [
else
$ O R0 O& w: x) n0 z3 D
line(c(i-1:i),d(i-1:i),y(i-1:i),'color',[0.5 0.5 0.5],'linewidth',2);
/ ]+ m8 T: Q9 h+ r! B
end
% V0 A: x" {8 [' Z/ ?/ X; N1 y# r2 d
pause(0.003);
$ S& R' `2 m- `) |
end
9 d9 E+ X4 V, J
cla;
: a. v6 t, i/ H
z=exp(-0.2*t).*sin(pi/24*t-x);
% ]" k! b: K/ v, J5 i% E
surf(t,x,z);
! K5 P' c) @7 y5 N' `
axis off
( R) ?2 l! x/ ~. r
colormap hot
9 C' z) j* J/ z9 @6 `
shading interp
0 u; \7 k E7 C" R" {1 s
material metal
. ?* y1 f# R. ~7 A- C
spinmap(10,2);
" y( V: z; l; b% K! M5 e& t
stop(t1)
+ U& h* Q/ d( }
作者:
chenhan
时间:
2011-3-4 07:37
很简单的一系列的三维图形动作
8 Y- O: I7 j' i' V( {" M. C
作者:
yangzh4645
时间:
2011-3-4 12:43
既然你诚信诚意的推荐了,那我就勉为其难的听听吧!
: w% i4 f4 ]9 [1 J
我是不是太肉麻了!数学中国社区我来了!
1 V/ B7 c: Z5 O+ i
作者:
刘小奔
时间:
2011-3-13 19:44
你把头像换换,跟要债似的,哈哈
作者:
高阳皇
时间:
2011-3-13 19:51
其实我一直觉得楼主的品味不错!呵呵!
5 s7 p) U8 S* x8 [
数学中国社区太棒了!
! u! J9 c* d/ c
欢迎光临 数学建模社区-数学中国 (http://www.madio.net/)
Powered by Discuz! X2.5