wait

Wait for futures to complete

Syntax

wait(F)
wait(F,state)
OK = wait(F,state,timeout)

Description

wait(F) blocks execution until each element of the array of futures F has reached the 'finished' state.

wait(F,state) blocks execution until each element of the array of futures F has reached the state state. Valid values for state are 'running' or 'finished'.

OK = wait(F,state,timeout) blocks execution for a maximum of timeout seconds. OK is false if timeout is exceeded before state is reached.

Introduced in R2013b