createTask
Create new task in job
Syntax
Description
creates a new task in job t
= createTask(j
,fcn
,N
,{x1,...,xn}
)j
and returns t
, the
corresponding task object. This task evaluates the function fcn
with
the cell array of input arguments {x1,...,xn}
and returns
N
output arguments.
If you attempt to create one task with arrays of cells arrays as input,
createTask
creates a task for each cell array. To create one task
with arrays of cell arrays as input, see Create Single Task with Arrays of Cell Array as Inputs.
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 fcn
. The cell array C1
provides the input
arguments to the first task, C2
to the second task, and so on, so that
each task has a corresponding cell array of input arguments.
If fcn
is a cell array, each element of fcn
specifies a function for each task and fcn
must have
m
elements. If N
is a numeric array, each element
specifies the number of output arguments for each task.
If fcn
is a cell array or N
is a numeric array,
their dimensions must match those of {C1,...,Cm}
. The output
t
is a vector with the same number of elements as
{C1,...,Cm}
.
Because a communicating job has only one task, this form of vectorized task creation is not appropriate for these jobs.
t = createTask(___,
specifies task object properties using one or more name-value arguments. For a list of
supported properties, see Name=Value
)parallel.Task
.
creates a task object with property values corresponding to 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