parfeval
Run function in background.
📝Syntax
f = parfeval(bPool, fptr, n, x1, ..., xm)
📥Input Arguments
Parameter Description
bPool backgroundPool object returned by backgroundPool().
fptr Function handle: Function to run.
n Number of output arguments.
x1, ..., xm Input arguments, specified as a comma-separated list of variables or expressions.
📤Output Arguments
Parameter Description
f FevalFuture object.
📄Description

f = parfeval(bPool, fptr, n, x1, ..., xm) starts the function fptr to run in the background.

backgroundPool has NumWorkers available. If there are more functions scheduled, functions wait than one entry is available in pool.

parfeval runs the function fptr on a background worker.

💡Examples
b = backgroundPool()
fptr = str2func('cos');
f = parfeval(b, fptr, 1, 5);
r = fetchOutputs(f)
🔗See Also
backgroundPoolfetchOutputsfeval
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub