2D Road animation
Ältere Kommentare anzeigen
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.
Antworten (0)
Kategorien
Mehr zu Animation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!