資源簡介
用matlab編寫的小動畫程序,實現(xiàn)鐘擺功能。擺動、分針、秒針、時針相應(yīng)跳動。
代碼片段和文件信息
function?pendulum(l)
figure
xmax=1.3*1;ymax=1.3*1;bas=3*1;bash=3*1;
fill([-xmax-0.05xmax+0.05xmax+0.05-xmax-0.05][ymax/50ymax/50-ymax/50-ymax/50][00.50]);
hold?on
fill([-xmax-0.025-xmax-0.005-xmax+0.005-xmax+0.025][ymax/50ymax/50+0.2ymax/50+0.2ymax/50][000.5]);
hold?on
fill([xmax-0.025xmax-0.005xmax+0.005xmax+0.025][ymax/50ymax/50+0.2ymax/50+0.2ymax/50][000.5]);
hold?on
t=0:pi/100:2*pi;Y=0.1*exp(i*t)+xmax+(ymax/50+0.2)*i;
plot(Y);hold?on
t=0:pi/100:2*pi;Y=0.1*exp(i*t)-xmax+(ymax/50+0.2)*i;
plot(Y);hold?on
plot([-xmaxxmax]
- 上一篇:GMM代碼用于目標檢測
- 下一篇:共軛梯度法相關(guān)matlab程序
評論
共有 條評論