uiresume
Resume execution of suspended program
Syntax
Description
Examples
Resume Execution After Button Press
Create a push button and wait until the user presses it. Then display a message.
Create a push button with the text Continue and a callback that
calls the uiresume
function when you click it. When program execution
begins, display a message in the Command Window. Pause program execution until you click
Continue or close the figure window. Then display a new
message.
fig = uifigure; btn = uibutton(fig); btn.Text = 'Continue'; btn.ButtonPushedFcn = 'uiresume(fig)'; disp('This text prints immediately'); uiwait(fig) disp('This text prints after you click Continue');
Resume Execution Using Function Call
Create an alert dialog box and wait until it receives a response before allowing program execution to continue.
Create a line plot in a UI figure and display an alert dialog box. Specify a
CloseFcn
callback for the dialog box that calls
uiresume
on the figure when the dialog box receives a response.
Pause program execution until you click OK in the dialog box or
close it. When program execution resumes, display a message in the Command Window.
To run this function, save it to a file named resumeInFunction.m
on
the MATLAB path. Run resumeInFunction
, and
then click the push button. MATLAB displays a message in the
Command Window.
function resumeInFunction fig = uifigure; fig.Position = [500 500 500 350]; ax = uiaxes(fig); plot(ax,1:10) uialert(fig,'A line plot was created in the axes.', ... 'Program Information','Icon','info','CloseFcn',@alertCallback) uiwait(fig) disp('Program execution resumed') function alertCallback(src,event) uiresume(fig) end end
For more information about specifying input arguments for callbacks, see Create Callbacks for Apps Created Programmatically.
Input Arguments
f
— Figure object
Figure
object
Figure object, specified as a Figure
object. Create the object by
using either the figure
or uifigure
function.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)