afterEach
Run function after each function finish running in the background.
📝Syntax
B = afterEach(F, fcn, n)
📥Input Arguments
Parameter Description
F Input Future object (scalar or array).
fcn Function handle: Function to run after all input futures.
n Number of output arguments.
📤Output Arguments
Parameter Description
B AfterEachFuture object.
📄Description

B = afterEach(F, fcn, n) returns a AfterEachFuture object B.

Function fcn is automatically runned after each element in the Future array F was finished.

If any of the elements in F encounters an error, the Error property of B contains an error.

💡Examples
pool = backgroundPool()
fptrRand = str2func('rand')
fptrMax = str2func('@(r) max(r)')
fptrMin = str2func('@(r) min(r)')
for idx= 1:10
    f(idx) = parfeval(pool, fptrRand, 1, 1000, 1);
end
maxFuture = afterEach(f, fptrMax, 1);
minFuture = afterAll(maxFuture, fptrMin, 1);
fetchOutputs(minFuture)
fetchOutputs(maxFuture)
🔗See Also
backgroundPoolfetchOutputsafterAll
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub