createTask
Create new task in job
Syntax
Description
creates a new task object in job t
= createTask(j
,fcn
,N
,{x1,...,xn}
)j
, and returns t
,
a handle to the added task object. This task evaluates the function specified by a function
handle or function name fcn
, with the given cell array of input
arguments {x1,...,xn}
, and returns N
output
arguments.
uses a cell array of t
= createTask(j
,fcn
,N
,{C1,...,Cm}
)m
cell arrays of input arguments to create
m
task objects in job j
. Each task evaluates the
function specified by a function handle or function name fcn
. The cell
array C1
provides the input arguments to the first task,
C2
to the second task, and so on, so that there is one task per cell
array of input arguments.
If fcn
is a cell array, each element of fcn
specifies a function for each task in the vector and must have m
elements. If N
is an array of doubles, each element specifies the
number of output arguments for each task.
Multidimensional matrices of inputs fcn
, N
and
{C1,...,Cm}
are supported. If fcn
is a cell
array, or N
is a double array, their dimensions must match those of
{C1,...,Cm}
. The output t
is a vector with the
same number of elements as {C1,...,Cm}
.
Note that because a communicating job has only one task, this form of vectorized task creation is not appropriate for such jobs.
t = createTask(___,
specifies task object properties using one or more name-value pair arguments. Use this
syntax in addition to any of the input argument combinations in previous syntaxes. For a
list of valid properties, see the Name,Value
)parallel.Task
object reference page. The
property name must be a character vector, with the value being the appropriate type for that
property. The values specified in these name-value pairs override the values in the profile.
If an invalid property name or property value is specified, the object is not
created.
creates a task object with the property values specified in the cluster profile
t
= createTask(___,"Profile",profileName
)'ProfileName'
. For details about defining and applying cluster
profiles, see Discover Clusters and Use Cluster Profiles.
Examples
Input Arguments
Output Arguments
Version History
Introduced before R2006a