MDFDatastore - Datastore for collection of MDF files - MATLAB (original) (raw)

Datastore for collection of MDF files

Description

Use the MDF datastore object to access data from a collection of MDF files.

Creation

Syntax

Description

`mdfds` = mdfDatastore([location](#mw%5Fc7f532df-e3bb-4c18-b27a-d6e7fba70d9c)) creates an MDFDatastore based on an MDF file or a collection of files in the folder specified by location. All files in the folder with extensions.mdf, .dat, or .mf4 are included.

`mdfds` = mdfDatastore(__,[Name=Value](#namevaluepairarguments),[Name=Value](#namevaluepairarguments),...) specifies function options and properties of mdfds using optional name-value pairs.

example

Input Arguments

expand all

Location of MDF datastore files, specified as a string, character vector, cell array, or object.

Data Types: string | char | cell | DsFileSet

Name-Value Arguments

expand all

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

These pairs set file information or object Properties. Allowed options areIncludeSubfolders, FileExtensions, and the properties ReadRaw, ReadSize,SelectedChannelGroupNumber, andSelectedChannelNames.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: SelectedChannelNames="Counter_B4"

Include files in subfolders, specified as a logical. Specifytrue to include files in each folder and recursively in subfolders.

Example: IncludeSubfolders=true

Data Types: logical

Custom extensions for filenames to include in the MDF datastore, specified as a string, string array, character vector, or cell array of character vectors. By default, the supported extensions include .mdf,.dat, and .mf4. If your files have custom or nonstandard extensions, use this Name-Value setting to include files with those extensions.

Example: FileExtensions=[".myformat1",".myformat2"]

Data Types: char | cell

Properties

expand all

This property is read-only.

All channel groups present in first MDF file, returned as a table of the same format returned by the mdfChannelGroupInfo function.

Data Types: table

This property is read-only.

All channels present in first MDF file, returned as a table of the same format returned by the mdfChannelInfo function.

Those channels targeted for reading must have the same name and belong to the same channel group in each file of the MDF datastore.

Data Types: table

Files included in the datastore, specified as a character vector, string, or cell array.

Example: ["file1.mf4","file2.mf4"]

Data Types: char | string | cell

Read raw data values, specified as true orfalse. If specified true, data are read as raw values. If specified false, data are read as physical values. The default value is false.

Example: ReadRaw=true

Data Types: logical

Size of data returned by the read function, specified as"file", a numeric value, or a duration. A string value of"file" causes the entire file to be read; a numeric double value specifies the number of records to read; and a duration value specifies a time range to read.

If you later change the ReadSize property value type, the datastore resets.

Example: 50

Data Types: double | string | char | duration

Channel group to read, specified as a numeric scalar value.

Example: 1

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Names of channels to read, specified as a string, string array, character vector, or cell array.

Those channels targeted for reading must have the same name and belong to the same channel group in each file of the MDF datastore. Unless specified otherwise, the default value is the channel names in channel group 1 sorted in alphabetical order.

Example: "Counter_B4"

Data Types: char | string | cell

Object Functions

Examples

collapse all

Create an MDF datastore from the sample fileCANape.MF4, and read it into a timetable.

mdfds = mdfDatastore("C:\myMDFData\CANape.MF4"); while hasdata(mdfds) m = read(mdfds); end

Version History

Introduced in R2017b

expand all

Because of the new mdfRead workflow underlying themdfDatastore functionality, the Conversion name-value pair argument is no longer supported. Code that uses this option generates an error. Instead, you can use the ReadRaw property and name-value argument.

Minor corresponding updates of data types and formats are also made to theReadSize, Channels,ChannelGroups, and SelectedChannelNames properties.

You can directly access MDF file data stored at remote locations, including Amazon S3, Azure® Blob Storage, and HDFS.

See Also