Halt execution temporarily
state = pause('query')
oldstate = pause(newstate)
pause, by itself, causes
the currently executing function to stop and wait for you to press
any key before continuing. Pausing must be enabled for this to take
pause on, below).
arguments also blocks execution of Simulink® models, but not repainting
pause(n) pauses execution
n seconds before continuing, where
any nonnegative real number. Pausing must be enabled for this to take
pause(inf) puts you into an infinite
loop. To return to the MATLAB® prompt, type Ctrl+C.
pause on enables the pausing
of MATLAB execution via the
Pausing remains enabled until you enter
pause off in
your function or at the command line.
pause off disables the
pausing of MATLAB execution via the
This allows normally interactive scripts to run unattended. Pausing
remains disabled until you enter
pause on in your
function or at the command line, or start a new MATLAB session.
pause query displays
pausing is currently enabled. Otherwise, it displays
state = pause('query') returns
state if pausing is currently enabled.
Otherwise, the value of
oldstate = pause(newstate), enables or
disables pausing, depending on the
newstate, and returns the former setting (also
'off') in character
The accuracy of
pause is subject to the
scheduling resolution of the operating system you are using, and also
to other system activity. It cannot be guaranteed with 100% confidence.
Asking for finer resolutions shows higher relative error.
While MATLAB is paused, the following continue to execute:
Repainting of figure windows, Simulink block diagrams, and Java® windows
HG callbacks from figure windows
Event handling from Java windows