Facts about MATLAB:
- MATLAB UI is Java Swing.
- MATLAB has excellent interoperability with Java, it is possible to initialize Java objects and call their methods directly from MATLAB code, it is even possible to pass in MATLAB defined listeners to Java!
My problem:
MATLAB does not offer background threads, so to make MATLAB UI responsive we have to call function drawnow which flushes Swing EDT queue, see also here and here. This is a known fact, so far so good.
But now I have a customer whose code which performs the computation is a MATLAB p-file (encrypted) so I have no access to the code to put drawnow
there.
Unsuccessful attempt:
I tried spinning up a timer to do the job of calling drawnow
but it does not seem to work - timer itself needs a precedent drawnow
to fire its callbacks.
EDIT: At the end I implemented GUI with .NET/WPF running on another thread, so it remains always responsive and looks much better then original MATLAB.