Eghbal
Eghbal

Reputation: 3783

MATLAB gui freeze after running my program

I create a GUI that use Parallel computing for accelerating Neural network and SVM models. When I enable Parallel computing in my GUI all thing (MATLAB,My GUI and my code's window) will freeze and I can't maximize these windows either, but my program is working,using workers and sometimes I can see updates in graphs and values of GUI. When I disable Parallel computing in my program everything is normal. In first situation sometimes my GUI turns to black color (Background of GUI,buttons,text-boxes and edit-boxes are good) but values are updating in iterations of created GUI.

What is this problem?

Thanks.

Upvotes: 1

Views: 1115

Answers (1)

patrik
patrik

Reputation: 4558

Sorry for the late answer. It is hard to give a definite answer to a solution here. The problem is quite advanced and most of the code we cannot do anthing about. What happens in parfor is probably that matlab puts some kind of lock (mutex or something else) on the elements it accesses at the moment. Also, since parfor works in parallel it is unlikely that any of the data in the loop is ever untouched. The only solution I can see is that you run shorter processes. That will allow your gui to update between the prcesses.

It would probably work to put a drawnow where you want the gui to update.

Other options could also be to place the gui in a location where you does not need to move it or dock it to the main window in matlab. But these are shortcuts which will only hide the problem.

Upvotes: 1

Related Questions