pause
Halt execution temporarily
Syntax
pause
pause(n)
pause on
pause off
pause query
state = pause(‘query’)
oldstate = pause(newstate)
Description
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 effect. (See pause on, below).
pause without arguments also blocks execution of Simulink
models, but not repainting of them.
pause(n) pauses for
n seconds before continuing, where n can also be a
fraction. The resolution
of the clock is platform specific. Fractional
pauses of 0.01 seconds
should be supported on most platforms.
pause(inf)
puts you into an infinite loop. To return to the MATLAB prompt,
type Ctrl+C.
pause causes a
procedure to stop and wait for the user to strike any
key before continuing.
pause OFF indicates
that any subsequent pause or pause(n) commands
should not actually pause.
This allows normally interactive scripts to
run unattended.
pause ON indicates
that subsequent pause commands should pause.
pause QUERY returns
the current state of pause, either ‘on’ or ‘off’.
STATE = pause(…)
returns the state of pause previous to processing
the input arguments.
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, but only with some expected
error. For example,
experiments have shown that choosing N with a
resolution of .1 (such as
N = 1.7) leads to actual pause values that
are correct to roughly 10%
in the relative error of the fractional
part. Asking for finer
resolutions (such as .01) shows higher relative
error.
Examples:
% Pause for 5 seconds
pause(5)
% Temporarily disable pause
pause off
pause(5) % Note that this does not pause
pause on
% Aternatively, disable/restore the state
pstate = pause(‘off’)
pause(5) % Note that this does not pause
pause(pstate);
Tips
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
今天的文章matlab中的pause函数,Matlab延时函数 pause分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/24289.html