User`s guide

batch
11-9
j = batch(fcn,N,{x1, ..., xn}) runs the function specified by a function handle
or function name, fcn, on a worker in the cluster identified by the default cluster profile.
The function returns j, a handle to the job object that runs the function. The function is
evaluated with the given arguments, x1,...,xn, returning N output arguments. The
function file for fcn is copied to the worker. (Do not include the .m file extension with the
function name argument.)
j = batch(myCluster,fcn,N,{x1,...,xn}) is identical to batch(fcn,N,
{x1,...,xn}) except that the function runs on a worker in the cluster identified by the
cluster object myCluster.
j = batch(...,'p1',v1,'p2',v2,...) allows additional parameter-value pairs
that modify the behavior of the job. These parameters support batch for functions and
scripts, unless otherwise indicated. The supported parameters are:
'Workspace' — A 1-by-1 struct to define the workspace on the worker just before the
script is called. The field names of the struct define the names of the variables, and
the field values are assigned to the workspace variables. By default this parameter
has a field for every variable in the current workspace where batch is executed. This
parameter supports only the running of scripts.
'Profile' — A single string that is the name of a cluster profile to use to identify
the cluster. If this option is omitted, the default profile is used to identify the cluster
and is applied to the job and task properties.
'AdditionalPaths' — A string or cell array of strings that defines paths to be
added to the MATLAB search path of the workers before the script or function
executes. The default search path might not be the same on the workers as it is on
the client; the path difference could be the result of different current working folders
(pwd), platforms, or network file system access. The 'AdditionalPaths' property
can assure that workers are looking in the correct locations for necessary code files,
data files, model files, etc.
'AttachedFiles' — A string or cell array of strings. Each string in the list
identifies either a file or a folder, which gets transferred to the worker.
'AutoAttachFiles' — A logical value to specify whether code files should be
automatically attached to the job. If true, the batch script or function is analyzed
and the code files that it depends on are automatically transferred to the worker. The
default is true.
'CurrentFolder' — A string indicating in what folder the script executes. There is
no guarantee that this folder exists on the worker. The default value for this property