2D Road animation
이전 댓글 표시
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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Animation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!