fetchNext
Retrieve next unread outputs from Future
array
Description
[
retrieves the linear index idx
,Y1,...,Ym
] = fetchNext(F
)idx
of the next unread
Future
object in the array F
that is finished, and
m
results from that Future
as
Y1,...,Ym
.
You can only use fetchNext
with Future
objects you
create using parfeval
.
A
Future
is unread if itsRead
property isfalse
. IfF
has no unread elements, MATLAB® throws an error.A
Future
is finished if itsState
property is'finished'
. If no unread elements are in the'finished'
state, MATLAB first waits for an element ofF
to finish.
fetchNext
reads elements from F
in order of
completion. After fetchNext
retrieves the outputs from the next
unread Future
object in the array F
, MATLAB sets the Read
property of that Future
to
true
.
If fetchNext
reads an element from F
that
encounters an error, the function first sets the Read
property of the
Future
element to true. Then, fetchNext
throws an
error.