waitfor
Wait for condition.
Syntax
waitfor(obj)
waitfor(obj, propertyName)
waitfor(obj, propertyName, propertyValue)
Input argument
obj - any scalar graphics object value.
propertyName - property name: character vector or string scalar.
propertyValue - property value: valid property value associated with propertyName.
Description
waitfor(obj) pauses the execution of statements until the specified object is closed (or deleted). Once the object is no longer present, waitfor returns, allowing the execution to continue. If the object does not exist at the time of the call, waitfor returns immediately.
waitfor(obj, propertyName) halts execution until the specified property of the object changes or the object is closed. For example, waitfor(hFig, 'UserData') pauses execution until the 'UserData' property of hFig changes. If the specified property name is invalid, an error stops execution.
waitfor(obj, propertyName, propertyValue) pauses execution until the specified property of the object changes to the given value. If the property is already equal to propvalue when waitfor is called, it returns immediately, allowing execution to resume.
Examples
See also
figure, waitforbuttonpress, pause.
History
1.7.0
initial version
Author
Allan CORNET
Last updated