Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

partition (MDFDatastore)

Partition MDF datastore

Syntax

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

Description

example

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.

Examples

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'});
mdfds.Files 
ans =
  3×1 cell array
    'c:\temp\CANape1.MF4'
    'c:\temp\CANape2.MF4'
    'c:\temp\CANape3.MF4'
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

Functions

Introduced in R2017b

Was this topic helpful?