Wait for job to change state
Job object whose change in state to wait for.
Value of the job object’s
Maximum time to wait, in seconds.
wait(j) blocks execution
in the client session until the job identified by the object
'finished' state or fails. This occurs when
all the job’s tasks are finished processing on the workers.
execution in the client session until the specified job object changes
state to the value of
The valid states to wait for are
If the object is currently or has already been in the specified
state, a wait is not performed and execution returns immediately.
For example, if you execute
a job already in the
'finished' state, the call
blocks execution until either the job reaches the specified
timeout seconds elapse, whichever happens first.
Simulink® models cannot run while a MATLAB® session
is blocked by
wait. If you must run Simulink from
the MATLAB client while also running jobs, you cannot use
Submit a job to the queue, and wait for it to finish running before retrieving its results.
submit(j); wait(j,'finished') results = fetchOutputs(j)
Submit a batch job and wait for it to finish before retrieving its variables.
j = batch('myScript'); wait(j) load(j)