MATLAB postpones disp calls when doing demanding calculations. Why is that?
algorithm, matlab
Solution
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.
Problem
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 through out the program to see what's happening all the time. However when starting on a particulary heavy for loop the `disp()` seemes not to be called until the loop is over even though it comes before the loop. Why is that? I thought that MATLAB was really executing sequentially or am I just choking it with too many calculations and the `disp()` calls get the lowest priority?