Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm doing a lot of simulations in Matlab in Windows XP. Typically I always have one Matlab open that runs a lenghty simulation while I do my work in another instance.

There are some annoyances. If I accidently click the "working" window name in task bar it will keep being marked yellow forever ( an hour or so ) and if I accidently rightclick on it a context menu will show - but never disappear. Covering other windows - most annoying.

I'm wondering are there tips how to make such a context menu disappear without killing my calculation.

Basically it will look like this forever: exemplary screen

So far I learnt that if I put some wait(0.1) commands in my code it will prevent this, but also horribly slow down my calculations. Therefore I don't consider it an option.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I would assume, by default, Matlab runs your simulation on the user interface thread. So while you're simulating, there is no time to handle anything related to the UI.

To work around this, you would have to instruct Matlab to run your simulations on a new thread. I found some bits on SO about this:

Information found on Google also seems to point in the direction of the Parallel Computing Toolbox.

share|improve this answer
    
good reference! I don't understand why - but just after calling matlabpool UI kept responsive. Hopefully it stays that way :) –  bdecaf Apr 12 '12 at 13:48

This is basically a byproduct the design of Windows - Applications receive "messages" in response to UI events and it is up to application to do things like repaint its window, resize, etc.

Windows will send the application the appropriate "messages" in response to events such as UI clicks, etc., but the application is allowed to completely ignore them and typically badly designed/ported applications might do that.

An application designed to "feel" interactive will A) interrupt what it is doing at various moments to process such messages, or B) have a separate thread that does the actual work. I can see where "feeling interactive" is not design priority of some applications, and if the application is in fact a development environment to run your own programs then the responsibility to "feel interactive" falls on you. I've played with Visual Studio and running programs that accidentally creating endless loops causing the application's CPU usage to shoot up to 100% does similar things with the UI.

I can't think of the name of any of these programs now but there are some programs out there that will let you do the "multiple workspace" thing like a lot of Linux desktops have. If you can put your instances of MATLAB in separate workspaces using such a program it might help prevent you from accidentally clicking on it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.