image thumbnail
from Getting Started with Parallel Computing using MATLAB by Arjav Chakravarti
This is an older version of the introductory tutorial for running parallel MATLAB applications

submitJob2b.m
%% This script submits a parfor script using batch
job2b = batch('testParforBatch','matlabpool',2);
wait(job2b);  % only can load when job is finished 
sprintf('Finished Running Job') 
load(job2b);  % loads all variables back
sprintf('Loaded Variables into Workspace')
% load(job2b, 'A');  % only loads variable A
destroy(job2b)  % permanently removes job data
sprintf('Test Completed')

Contact us at files@mathworks.com