User`s guide
11 Functions — Alphabetical List
11-8
batch
Run MATLAB script or function on worker
Syntax
j = batch('aScript')
j = batch(myCluster,'aScript')
j = batch(fcn,N,{x1, ..., xn})
j = batch(myCluster,fcn,N,{x1,...,xn})
j = batch(...,'p1',v1,'p2',v2,...)
Arguments
j The batch job object.
'aScript' The script of MATLAB code to be evaluated by the worker.
myCluster Cluster object representing cluster compute resources.
fcn Function handle or string of function name to be evaluated by the
worker.
N The number of output arguments from the evaluated function.
{x1, ..., xn} Cell array of input arguments to the function.
p1, p2 Object properties or other arguments to control job behavior.
v1, v2 Initial values for corresponding object properties or arguments.
Description
j = batch('aScript') runs the script code of the file aScript.m on a worker in the
cluster specified by the default cluster profile. (Note: Do not include the .m file extension
with the script name argument.) The function returns j, a handle to the job object that
runs the script. The script file aScript.m is copied to the worker.
j = batch(myCluster,'aScript') is identical to batch('aScript') except that
the script runs on a worker according to the cluster identified by the cluster object
myCluster.