fetchOutputs
Retrieve results from function running in the background
Description
[
retrieves Y1,...,Ym
] = fetchOutputs(F
)m
results from a Future
array
F
.
Each element in F
must return at least m
output
arguments. To check how many output arguments a Future
object has, use the
NumOutputArguments
property.
MATLAB® waits for the function associated with each element in F
to finish before retrieving results from that element. The State
property
of a Future
object is 'finished'
when the associated
function is finished. When you use fetchOutputs
, MATLAB sets the Read
property of each element in
F
to true
.
You create a Future
object when you use parfeval
,
parfevalOnAll
, afterEach
, or
afterAll
to:
Run a function in the background using
backgroundPool
.Run a function on a parallel pool worker when you use Parallel Computing Toolbox™.
If F
is an array of Future
objects, the
jth output from each element in F
is
concatenated to form the output Yj
. Use this syntax only if the
jth output from each element can be concatenated along the
first dimension.
[
retrieves Y1,...,Ym
] = fetchOutputs(F
,UniformOutput=false)m
results as cell arrays from a Future
array
F
.
If F
is an array of Future
objects, the
jth output from each element in F
is
concatenated in a cell array to form the output Yj
. Use this syntax if,
for any output of Yj
, you are unable to concatenate the output from each
element along the first dimension.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2013b