I would do it like this:
tstep = .1;
figure(1)
for n = 1:length(x1)
plot3(x1(1:n),y1(1:n),z1(1:n),'+-',x2(1:n),y2(1:n),z2(1:n),'+-')
title((n-1)*tstep);
pause(.01)
end
If the default view of the plot is bad mess around with the view function to try and get a better one. This will make an animation with both, to make the other two animations simply repeat it and leave out the xyz coordinates of the one you do not want to look at.
edit: fixed so it should actually work now
0 Comments
Sign in to comment.