| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
pause
pause(n)
pause on
pause off
pause query
state = pause('query')
oldstate = pause(newstate)
pause, by itself, causes the currently executing M-file to stop and wait for you to press any key before continuing. Pausing must be enabled for this to take effect. (See pause on, below). pause without arguments also blocks execution of Simulink models, but not repainting of them.
pause(n) pauses execution for n seconds before continuing, where n can be any nonnegative real number. The resolution of the clock is platform specific. A fractional pause of 0.01 seconds should be supported on most platforms. Pausing must be enabled for this to take effect.
Typing 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 pause and pause(n) commands. Pausing remains enabled until you enter pause off in your M-file or at the command line.
pause off disables the pausing of MATLAB execution via the pause and pause(n) commands. This allows normally interactive scripts to run unattended. Pausing remains disabled until you enter pause on in your M-file or at the command line, or start a new MATLAB session.
pause query displays 'on' if pausing is currently enabled. Otherwise, it displays 'off'.
state = pause('query') returns 'on' in character array state if pausing is currently enabled. Otherwise, the value of state is 'off'.
oldstate = pause(newstate), enables or disables pausing, depending on the 'on' or 'off' value in newstate, and returns the former setting (also either 'on' or 'off') in character array oldstate.
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
![]() | pathtool | pbaspect | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |