MATLAB: Trajectory animation using coordinate points

trajectory animation using coordinate points

I have set of x, y and z coordinates of two objects and I want to create animation of the object's 3D trajectory/motion using these coordinates. Consider the first coordinate in the set as the initial position. Can anyone help me with this.

Best Answer

Animation it is just changing of images like in cartoons
plot(x,y,z)
hold on
for i = 1:length(x)
h = plot(x(i),y(i),z(i),'^r'); % draw something on the trajectory
pause(0.2) % wait a minute
delete(h) % delete it
end
hold off
Related Question