afterEach
Run function after each function finishes running in the background
Description
runs the functionB
= afterEach(A
,fcn
,n
)fcn
automatically after each element in theFuture
arrayA
finishes and returns aFuture
objectB
.
MATLAB®runs the functionfcn
using the outputs from each element inA
. If theFuture
arrayA
hasM
elements, MATLAB runs the functionM
times. When the scheduled functionfcn
finishes for theM
thtime, theFuture
objectB
finishes.
For more information about usingafterEach
to run functions after they finish running on a parallel pool, seeUse afterEach and afterAll to Run Callback Functions(Parallel Computing Toolbox).
If any of the elements inA
encounters an error, theError
property ofB
is a cell array with the same number of elements asA
.