This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Resume execution of blocked program




uiresume(h) resumes the program execution that uiwait suspended.


This example code creates a window containing a push button. The uiwait function blocks MATLAB® execution until the user clicks the push button.

f = figure;
h = uicontrol('Position',[20 20 200 40],'String','Continue',...
disp('This will print immediately');
disp('This will print after you click Continue');

The gcbf function returns the current figure.


The uiwait and uiresume functions block and resume MATLAB program execution. When creating a dialog box, you should have a uicontrol component with a callback that calls uiresume or a callback that destroys the dialog box. These are the only methods that resume program execution after the uiwait function blocks execution.

When used in conjunction with a modal dialog box, uiresume can resume the execution of the program that uiwait suspended while presenting a dialog box.

Introduced before R2006a