Create and Save a time varying animation of x-y position
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a time varrying integration simulation that outputs a Time vector "T" where T(1) = 0 and T(end) = simulation run time but the steps between T(i) and T(i+1) is not constant, it also outputs a position vector Q where Q(1,1) = my initial x position and Q(2,1) is my initial y position. Q(1,end) is the x-position at the end of the simulation and Q(2,end) is the y-position at the end of the simulation.
I want to create and save (to use in a presentation) an animation of the x-y position that varries with time giving you a sense of the velocity as well.
Right now the code I am using below has two issues:
1: I can't save the animation
2: The animation doesn't incorporate the variance in time giving the animation a constant velocity feel when in actuality my velocity is increasing.
plot(Q(1,:),Q(2,:))
hold on
for i = 1:length(Q(1,:))
h = plot(Q(1,i),Q(2,i),'^r');
pause(0.0001)
delete(h)
end
댓글 수: 0
답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!