首页 > 其他 > 详细

绘制动态

时间:2018-08-25 10:15:16      阅读:108      评论:0      收藏:0      [点我收藏+]
axis([0 10 0 10]);
hold on 
xy=[];
n=0;
disp(‘Left mouse button picks points‘)
disp(‘Right mouse button picks last point‘)
but=1;
while but==1
    [xi,yi,but]=ginput(1);
    plot(xi,yi,‘ro‘)
    n=n+1;
    xy(:,n)=[xi,yi];
end
t=1:n;
ts=1:0.1:n;
xys=spline(t,xy,ts);  % 三次方样条数据插值函数 根据xy的值,每两个xy值之间插入(1/0.01)-1个数,t是xy中个数向量...
%[1 2 3  4...n],xys是最后的值
plot(xys(1,:),xys(2,:),‘b-‘,‘linewidth‘,2)
hold off 

  技术分享图片

绘制动态

原文:https://www.cnblogs.com/Airboy1/p/9532931.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!