FUNCTION REFERENCE
uiwait
Block execution until a figure or dialog resumes or closes.
Block execution until a figure or dialog resumes or closes.
Syntax
uiwaitSyntax
uiwait(h)Syntax
uiwait(h, timeout)Waits on a uifigure, a classic figure with uicontrols, or a dialog handle from msgbox, errordlg, warndlg, helpdlg, or waitbar (or the current uifigure when h is omitted). While waiting in the desktop app, UI callbacks still run; execution continues when uiresume(h) is called, the window closes, timeout seconds elapse, or the run is stopped. In -batch mode uiwait returns immediately without blocking.
Example
uiwait(warndlg('Check the plot, then click OK.'));Differences from MATLAB: Classic figures with neither uicontrols nor an open uialert/uiconfirm are not blocked by uiwait; in -batch mode uiwait returns immediately.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.