Documentation

fetchOutputs (job)

Retrieve output arguments from all tasks in job

Syntax

data = fetchOutputs(job)

Description

data = fetchOutputs(job)retrieves the output arguments contained in the tasks of a finished job. If the job has M tasks, each row of the M-by-N cell arraydatacontains the output arguments for the corresponding task in the job. Each row has N elements, where N is the greatest number of output arguments from any one task in the job. The N elements of a row are arrays containing the output arguments from that task. If a task has less than N output arguments, the excess arrays in the row for that task are empty. The order of the rows indatais the same as the order of the tasks contained in the job’sTasksproperty.

CallingfetchOutputsdoes not remove the output data from the location where it is stored. To remove the output data, use thedeletefunction to remove individual tasks or entire jobs.

fetchOutputsreports an error if the job is not in the'finished'state, or if one of its tasks encountered an error during execution. If some tasks completed successfully, you can access their output arguments directly from theOutputArgumentsproperty of the tasks.

Examples

创建一个工作来生成一个随机矩阵:

myCluster = parcluster;% Use default profilej = createJob(myCluster,'Name','myjob'); t = createTask(j,@rand,1,{10}); submit(j);

Wait for the job to finish and retrieve the random matrix:

wait(j) data = fetchOutputs(j); data{1}

Introduced in R2012a

Was this topic helpful?