MATLAB postpones disp calls when doing demanding calculations. Why is that?

后端 未结 1 654
生来不讨喜
生来不讨喜 2020-12-19 16:58

I am implementing an algorithm in MATLAB. Among other things it calculates the shortest paths etc. so it\'s quite demanding for my old computer. I\'ve put in disp() calls th

相关标签:
1条回答
  • 2020-12-19 17:50

    I am almost certain it is because of EDT.

    That's the function drawnow() is for. See article of Yair Altman for good explanation.

    Summary: MATLAB graphics is Java Swing and operations happen on a special thread - Event Dispatch Thread (EDT). Calling drawnow(); flushes event queue and updates figure window.

    0 讨论(0)
提交回复
热议问题