This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

partition (MDFDatastore)

Partition MDF datastore


subds = partition(mdfds,N,index)
subds = partition(mdfds,'Files',index)
subds = partition(mdfds,'Files',filename)



subds = partition(mdfds,N,index) partitions the MDF datastore mdfds into the number of parts specified by N, and returns the partition corresponding to the index index.


subds = partition(mdfds,'Files',index) partitions the MDF datastore by files and returns the partition corresponding to the file of index index in the Files property.


subds = partition(mdfds,'Files',filename) partitions the datastore by files and returns the partition corresponding to the specified filename.


collapse all

Partition an MDF datastore from the sample file CANape.MF4, and return the first part.

mdfds = mdfDatastore(fullfile(matlabroot,'examples','vnt','CANape.MF4'));
N = numpartitions(mdfds);
subds1 = partition(mdfds,N,1); 

Partition an MDF datastore according to its files, and return partitions by index and file name.

cd c:\temp
mdfds = mdfDatastore({'CANape1.MF4','CANape2.MF4','CANape3.MF4'});
ans =
  3×1 cell array
subds2 = partition(mdfds,'files',2);
subds3 = partition(mdfds,'files','c:\temp\CANape3.MF4'); 

Input Arguments

collapse all

MDF datastore, specified as an MDF datastore object.

Example: mdfds = mdfDatastore('CANape.MF4')

Number of partitions, specified as a double of positive integer value. Use the numpartitions function for the recommended number or partitions.

Example: numpartitions(mdfds)

Data Types: double

Index, specified as a double of positive integer value. When using the 'files' partition scheme, this value corresponds to the index of the MDF datastore object Files property.

Example: 1

Data Types: double

File name, specified as a character vector. The argument can specify a relative or absolute path.

Example: 'CANape.MF4'

Data Types: char

Output Arguments

collapse all

MDF datastore partition, returned as an MDF datastore object. This output datastore is of the same type as the input datastore mdfds.

See Also


Introduced in R2017b