Main Content

mdfSort

Sort MDF file by ASAM standards

Description

If you get an error when trying to read an unsorted MDF file, sort the file with mdfSort and read from that instead.

mdfSort(UnsortedMDFFile) sorts the specified MDF file according to ASAM standards for fast reading. The sorted result overwrites the original file.

example

mdfSort(UnsortedMDFFile,SortedMDFFile) creates a sorted copy of the MDF file with the specified name, SortedMDFFile.

example

sortedPath = mdfSort(___) returns an output argument, sortedPath, indicating the full path to the sorted file, including the file name.

example

Examples

collapse all

Sort an MDF file, overwriting the original, and read its data.

sortedPath = mdfSort('MDFFile.mf4');
mdfObj = mdf(sortedPath);
data = read(mdfObj);

Create a sorted copy of an MDF file and read its data.

sortedPath = mdfSort('UnsortedMDFFile.mf4','SortedMDFFile.mf4');
mdfObj = mdf(sortedPath);
data = read(mdfObj);

Input Arguments

collapse all

Original MDF file without sorted data, specified as a string or character vector. Full and relative path names are allowed.

Depending on the location you are accessing, mdfFileName can take one of these forms.

Location

Form

Current folder or MATLAB® path

To access a file in the current folder or MATLAB path, specify the name of the file in filename, including the file extension.

Example: "myMdfFile.mf4"

Other folders

To access a file in a folder other than the current folder, specify the full or relative path name in filename.

Example: "C:\myFolder\myMdfFile.mf4"

Example: "\dataDir\myMdfFile.mf4"

Remote locations

To access a file in a remote location, filename must contain the full path of the file specified as a uniform resource locator (URL) of the form:

scheme://path_to_file/myMdfFile.mf4

Based on the remote location, scheme can be one of the values in this table.

Remote Locationscheme
Amazon S3™s3
Windows Azure® Blob Storagewasb, wasbs
HDFS™hdfs

For more information, see Work with Remote Data.

Example: "s3://bucketname/path_to_file/myMdfFile.mf4"

Example: 'UnsortedMDFFile.mf4'

Data Types: char | string

New copy of MDF file with sorted data, specified as a string or character vector. Full and relative path names are allowed.

Example: 'SortedMDFFile.mf4'

Data Types: char | string

Output Arguments

collapse all

Full path to sorted file, returned as a character vector. The path includes the file name.

Version History

Introduced in R2019b

expand all

See Also

Functions