Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

prog::wait

Wait for a while

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

prog::wait(m)
prog::wait(s)

Description

prog::wait(m) waits for m milli seconds.

prog::wait(s) waits for s seconds.

prog::wait uses the function rtime for time measurement.

Examples

Example 1

Wait for 3 seconds:

prog::wait(3000)

Wait for 3 seconds again:

prog::wait(3.0)

The next example shows the difference between the system time and the CPU time used by MuPAD®:

time(prog::wait(2.5))

In 2.5 seconds realtime the MuPAD process runs nearly two seconds.

Example 2

Use traperror to limit the evaluation time:

traperror(prog::wait(100.0), 5): lasterror()
Error: Execution time is exceeded.

Parameters

m

Milli seconds to wait as positive integer

s

Seconds to wait as positive floating-point number

Return Values

prog::wait returns the empty object null().

See Also

MuPAD Functions

Was this topic helpful?