Main Content

partition

Partition MDF datastore

Description

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.

example

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.

example

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

example

Examples

collapse all

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

mdfds = mdfDatastore("C:\myMDFData\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:\myMDFData
mdfds = mdfDatastore({'CANape1.MF4','CANape2.MF4','CANape3.MF4'});
mdfds.Files 
ans =
  3×1 cell array
    'C:\myMDFData\CANape1.MF4'
    'C:\myMDFData\CANape2.MF4'
    'C:\myMDFData\CANape3.MF4'
subds2 = partition(mdfds,'files',2);
subds3 = partition(mdfds,'files','C:\myMDFData\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.

Version History

Introduced in R2017b

See Also

Functions