Main Content

read

Read data in MDF datastore

Description

data = read(mdfds) reads data from the MDF datastore specified by mdfds, and returns a timetable.

The read function returns a subset of data from the datastore. The size of the subset is determined by the ReadSize property of the datastore object. On the first call, read starts reading from the beginning of the datastore, and subsequent calls continue reading from the endpoint of the previous call. Use reset to read from the beginning again.

example

[data,info] = read(mdfds) also returns to the output argument info information, including metadata, about the extracted data.

example

Examples

collapse all

Read data from an MDF datastore one file at a time.

mdfds = mdfDatastore({'CANape1.MF4','CANape2.MF4','CANape3.MF4'});
mdfds.ReadSize = 'file';
data = read(mdfds); 

Read the second file and view information about the data.

[data2,info2] = read(mdfds);
info2 
  struct with fields:

             Filename: 'CANape2.MF4'
             FileSize: 57592
    MDFFileProperties: [1×1 struct]

Input Arguments

collapse all

MDF datastore, specified as an MDF datastore object.

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

Output Arguments

collapse all

Output data, returned as a timetable of MDF records.

Information about data, returned as a structure array with the following fields:

Filename
FileSize
MDFFileProperties

Version History

Introduced in R2017b