필터 지우기
필터 지우기

Efficient way to display a walked path.

조회 수: 3 (최근 30일)
luc
luc 2014년 12월 23일
답변: Image Analyst 2014년 12월 23일
I have an object that has coordinates [x,y], the object moves in the x-y plane. The plane is described by a circular set of datapoints, as shown in the figure below.
I wish to display the "path" the object has taken (red) , and the current location (green).
I was thinking of displaying it something like the lower image, but any other way would be usefull too.
Any suggestions? (I'm not asking for any code :), I can figure that out on my own)

채택된 답변

Image Analyst
Image Analyst 2014년 12월 23일
Assuming you have the (x,y) coordinates of the path, just use plot() and pick a really wide line width.
plot(x, y, 'LineWidth', 10);

추가 답변 (1개)

per isakson
per isakson 2014년 12월 23일
편집: per isakson 2014년 12월 23일
Something looking similar to the upper diagram can be achieved with a couple of transparent pathes (handle graphic objects) on top.
See
Patches comes with a bit of learning curve. Try fill first.
&nbsp
The lower diagram can be done with a line object on top. See
R2014b came with improved graphic features. The links above ara to R2014b.
&nbsp
The key to "efficient" (fast) is to modify graphic objects, not delete and recreate objects, and not create many thousands of objects.

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by