subds = partition(ds,N,index)
partitions a datastore ds into N parts and
returns the partition corresponding to index.
subds = partition(ds,'Files',fileIndex)
partitions the PixelLabelDatastore or
pixelLabelImageDatastore by files. The partitioned
datastore corresponds to the index in the
Files property of the datastore.
subds = partition(ds,'Files',filename)
partitions the PixelLabelDatastore or
pixelLabelImageDatastore by files. The partitioned
datastore corresponds to the file specified by
filename.
Number of partitions to divide datastore, specified as a positive integer.
To obtain an estimate for a reasonable number of partitions, use the
numpartitions
function.
numWorkers = 3;
p = parpool('local',numWorkers);
n = numpartitions(ds,p);
parfor ii=1:n
subds = partition(ds,n,ii);
while hasdata(subds)
data = read(subds);
end
end
Example: 3
Data Types: double
index — Index positive integer
Index, specified as an integer. The index points to a partitioned
datastore of the N number of partitioned
datastores.