MATLAB中comet、comet3函数-绘制质点运动轨迹

本文介绍了如何使用MATLAB中的comet和comet3函数来绘制各种运动轨迹,包括平抛运动、导弹发射及匀速圆周运动等,并提供了具体的代码示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用comet、comet3函数,前者是二维,后者是三维
comet(y)显示质点绕向量y,comet(x,y)显示质点绕向量y与x,comet(x,y,p),其中为轨迹尾巴的长度
以comet(x,y)为例,

显示平抛运动
   vx =40;
   t =0:0.001:10;
   x = vx*t;
   y =-9.8*t.^2/2;
  comet(x,y)


显示导弹发射
   vx =100*cos(1/4*pi);
   vy =100*sin(1/4*pi);
   t =0:0.001:15;
   x = vx*t;
   y =vy*t-9.8*t.^2/2;
  comet(x,y)


匀速圆周运动
   sita =0:0.0001:2*pi;
   r = 10;
  x=r*cos(sita);
  y=r*sin(sita);
   comet(x,y)


comet3与comet的用法相类似,可以在帮助文件里的例子
 COMET Comet-like trajectory.
    COMET(Y)displays an animated comet plot of the vector Y.
    COMET(X,Y)displays an animated comet plot of vector Y vs. X.
    COMET(X,Y,p)uses a comet of length p*length(Y).  Default is p= 0.10.
 
   COMET(AX,...) plots into AX instead of GCA.
 
   Example:
       t = -pi:pi/200:pi;
       comet(t,tan(sin(t))-sin(tan(t)))

 

转:http://blog.sina.com.cn/s/blog_93fa35820100vl2v.html

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值