User`s guide
11 Functions — Alphabetical List
11-50
Examples
The following examples all use a local parallel pool of four workers, opened with the
statement:
p = parpool('local',4);
This example shows how to create a Composite object with no defined elements, then
assign values using a for-loop in the client.
c = Composite(); % One element per worker in the pool
for w = 1:length(c)
c{w} = 0; % Value stored on each worker
end
This example shows how to assign Composite elements in an spmd block.
c = Composite();
spmd
c = 0; % Value stored on each worker
end
This example shows how to assign the elements of a Composite with a value from each
worker.
c = Composite();
spmd
c = labindex;
end
c{:}
1
2
3
4
This example shows how to use a distributed array vector to set the values of a
Composite.