Animate trajectory using Octave

我是研究僧i 提交于 2019-12-05 17:43:32

You can use the set command to change just the XData and YData data for a certain plot object h:

h = plot(my_xdata(0),my_ydata(0))
for i_=1:length(my_xdata)
    set(h, 'YData', my_ydata(i_))
    set(h, 'XData', my_xdata(i_))
    pause(sqrt(vx(i_)^2+vy(i_)^2))
end

The pause(x) command pauses for x seconds, which can be less than 1.

I think you are looking for the "hold" command. holding the plot keeps all previous data on the plot and the new data is added on top.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!