pause vs drawnow in app designer
조회 수: 50 (최근 30일)
이전 댓글 표시
Hi folks,
in my current function I used drawnow to update a figure in a while loop. But drawnow seems to slow down the programm (there are lots of topics on this). I know about the drawnow limitrate, but this command doesn't work with Matlab Compiler (figure begins to blink when compiled).
So today i tried to use the pause command instead of drawnow. This seems to speedup the code and the redrawing of the figure but all the interactivity of callbacks get's lost (needs lots of time!!!).
Is there anything else I could try to increase the performance of my code?
댓글 수: 1
답변 (2개)
Mario Malic
2020년 10월 13일
I use drawnow in combination with the pause of 0.1s. I did not experiment with the values of pause.
while
%code
drawnow
pause (0.1)
end
They don't get lost, it's just that they get queued because program waits as it has been told.
댓글 수: 12
Mario Malic
2020년 10월 13일
Actually it's not the uiaxes, it's the issue with uifigure. What exactly with it, I wouldn't know.
fig = figure; % 0.124s
ax = axes(fig);
fig = figure; % 0.152s
ax = uiaxes(fig);
Bruno Luong
2020년 10월 13일
편집: Bruno Luong
2020년 10월 13일
Confirmed, I cross check,
matlab.graphics.axis.Axes in UIfigure (app designer): slow 0.0303
ax = axes(figure): fast 0.0071
ax = uiaxes(figure): fast 0.0079
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!