maxpartitions
Class: matlab.io.datastore.DsFileSet
Namespace: matlab.io.datastore
Maximum number of partitions
Syntax
N = maxpartitions(fs)
Description
returns the maximum number of partitions for a given N
= maxpartitions(fs
)DsFileSet
object
fs
.
Input Arguments
Output Arguments
Examples
Get Maximum Number of Partitions for the File-Set Object
Create a file-set object and get the number of partitions for different values of
the FileSplitSize
property.
Create a file-set object for all .mat
files in a folder and
check the number of
files.
folder = fullfile(matlabroot,'toolbox','matlab','demos'); fs = matlab.io.datastore.DsFileSet(folder,'FileExtensions','.mat'); fs.NumFiles
ans = 40
The FileSplitSize
property of the DSFileSet
object is set to 'file'
. Therefore,
maxpartitions
returns a value equal to the number of files.
maxpartitions(fs)
ans = 40
Set the FileSplitSize
property to a numeric size
(2000
bytes) and compute maxpartitions
.
fs = matlab.io.datastore.DsFileSet(folder,... 'FileExtensions','.mat',... 'FileSplitSize',2000); n = maxpartitions(fs)
n = 1752
Version History
Introduced in R2017b