Help for plotting a moving object
31 ビュー (過去 30 日間)
古いコメントを表示
Dear all,
I am doing a project about multi-lanes highway simulation, and to get starting, I am looking for some literatures to guide me how to draw/plot moving objects, like cars, in Matlab or does someone have the code ? Please help me ! Thanks a lot
1 件のコメント
wael ali
2015 年 12 月 10 日
hi every one, how can I model a moving train scenario that move linearly from point 1 to point 2
回答 (2 件)
Happy61
2013 年 5 月 28 日
編集済み: Happy61
2013 年 5 月 31 日
It may sound complicated but it's really easy to draw/plot moving object in MATLAB.
h=[];
for j=1:TimeSteps
delete(h)
h=plot (x.position(1,j), y.position(1,j))
drawnow;
end
TimeSteps: being duration of the simulation, x, y are the x and y position of your vehicle for each timestep.
I have experience building traffic simulator in MATLAB, so if you have any more questions don't hesitate to ask.
12 件のコメント
Walter Roberson
2021 年 11 月 18 日
Please post your attempt along with the error message you are getting.
Walter Roberson
2018 年 1 月 18 日
You should consider creating one hgtransform for each object to be drawn, and then set the Parent of the object to be drawn to be the hgtransform. Then when you need to move or rotate the object, change the transform matrix of the hgtransform; you might find hgmaketform() handy for that.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Object Containers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!