MATLAB: GUI push button problem

guimultiple buttonspush button

I have a project with GUI that contains two puss buttons the first called run when press on it it starts a simulation program that contains plotting of a figure I hide this figure because I want the second button to review the hidden figure by pressing it the second button called display network the problem is that when I press display network the action do not performed until the simulation program finishes How I make it possible to perform the action of second button while the action of the first button is still working

Best Answer

You simply need to add the line:
drawnow;
to the code running the simulation steps so that Matlab flushes the event queue (and "reads-in" any potential buttonpress).