| Parallel Computing Toolbox™ | ![]() |
psave(fileroot)
fileroot | Part of filename common to all saved files. |
psave(fileroot) saves the data from the labs' workspace into the files named [fileroot num2str(labindex)]. The files can be loaded by using the pload command with the same fileroot, which should point to a directory accessible to all the labs. If fileroot contains an extension, the character representation of the labindex is inserted before the extension. Thus, psave('abc') creates the files 'abc1.mat', 'abc2.mat', etc., one for each lab.
Create three variables — one replicated, one variant, and one distributed. Then save the data.
clear all;
rep = speye(numlabs);
var = magic(labindex);
D = eye(numlabs,distributor());
psave('threeThings');This creates three files (threeThings1.mat, threeThings2.mat, threeThings3.mat) in the current working directory.
Clear the workspace on all the labs and confirm there are no variables.
clear all whos
Load the previously saved data into the labs. Confirm its presence.
pload('threeThings');
whos
isreplicated(rep)
isdistributed(D)load, save MATLAB® function reference pages
labindex, numlabs, pmode, pload
![]() | promote | rand | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |