2D Road animation
Show older comments
I am animating a road which will be used in the analysis of a half car suspension model. At the moment the plot follows the road as it is being generated. What I want to do is plot the car in the middle of the plot and pull the road from right to left underneath the car.
for t = 1:200
r = road(t);
R(t,:) = r;
% pause(.05)
set(line,'YData',R); %# Update the y data of the line
drawnow %# Force the graphics to update immediately
ylim([-1 1])
xlim([t-5 t+5])
end
figure; plot(R,'k');
ylim([-1 1])
Does anyone have any suggestions on how to, rather than follow the road, have it come across the figure. Any help is much appreciated.
1 Comment
James Murphy
on 26 Apr 2016
Answers (0)
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!