Speeding up Plotting Lines Using the Mapping Package

조회 수: 9 (최근 30일)
Nick Hunn
Nick Hunn 2017년 8월 21일
편집: Chad Greene 2017년 8월 22일
Hi, I've got a bunch of GPS data from runs of a car and want to plot it nicely on a map with delays between each point. I've tried using wmline in a loop plotting it piecewise, but it's very slow and hangs after plotting a few hundred points. Does anyone have any suggestions on speeding it up?
Plotting it as points also works as there's enough data for that to work but I don't want the big markers from the wmmarker command though the additional data would be useful (I've also got velocity, speed, heading, etc.). My mapping code is below:
for(i=2:size(lat,1))
wmline([lat(i-1,1)/10^7,lat(i,1)/10^7],[long(i-1,1)/10^7,long(i,1)/10^7]);
pause(0.1);
end

답변 (1개)

Chad Greene
Chad Greene 2017년 8월 22일
편집: Chad Greene 2017년 8월 22일
Why use a loop? You should be able to do
wmline(lat*1e-7,long*1e-7)
without any loops at all. If you must use a loop, you can speed it up by removing that 0.1 second pause each time through the loop.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by