Main Content

mdfInfo

Access or create MDF file metadata

Description

fileInfo = mdfInfo(mdfFileName) returns an MDFInfo object that contains information about the specified MDF file, including name, location, version, size, initial timestamp of the data, and more. mdfFileName specifies an absolute, relative, or URL path to the MDF file.

example

fileInfo = mdfInfo creates a default MDFInfo object that you can customize and use with mdfCreate (Vehicle Network Toolbox) to configure MDF file metadata during file creation.

example

Examples

collapse all

Get the MDF file information, and programmatically read its version.

fileInfo = mdfInfo("MDFFile.mf4");
fileInfo = 

  MDFInfo with properties:

   File Details
                  Name: "VehicleData.mf4"
                  Path: "E:\data\VehicleData.mf4"
                Author: ""
            Department: ""
               Project: ""
               Subject: ""
               Comment: "Example file with demo data."
               Version: "4.10"
      InitialTimestamp: 2022-01-20 01:22:34.000000000

   Creator Details
     ProgramIdentifier: "MATLAB"
     CreatorVendorName: "The MathWorks, Inc."
       CreatorToolName: "MATLAB"
    CreatorToolVersion: "9.12.0.1846952 (R2022a)"
       CreatorUserName: ""
        CreatorComment: ""

   File Contents
            Attachment: [1×8 table]
     ChannelGroupCount: 2
                 Event: [1x8 eventtable]

Read the Version property.

fileInfo.Version
ans =

    "4.10"

Create and modify an MDFInfo object for use in configuring a new MDF file with customized metadata.

minfo = mdfInfo;
minfo.Comment = "25-Dec Shift B.";
%   ⋮
% Modify other properites as needed
%   ⋮
mdfCreate("MyMDFfile.mf4",FileInfo=minfo)

Input Arguments

collapse all

MDF file name, specified as a string or character vector, including the necessary full or relative path. You can use a URL to specify a file on a remote server.

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"

Data Types: char | string

Output Arguments

collapse all

MDF file metadata information, returned as an MDFInfo object with the following properties:

MDFInfo Object Properties

Property NameData TypeAccess
File Details
NamestringRead-only
PathstringRead-only
AuthorstringRead/write
DepartmentstringRead/write
ProjectstringRead/write
SubjectstringRead/write
CommentstringRead/write
VersionstringRead/write
InitialTimestampdatetimeRead/write
Creator Details
ProgramIdentifierstringRead-only
CreatorVendorNamestringRead-only
CreatorToolNamestringRead-only
CreatorToolVersionstringRead-only
CreatorUserNamestringRead/write
CreatorCommentstringRead/write
File Contents
AttachmenttableRead-only
ChannelGroupCountuint64Read-only
EventeventtableRead-only

Limitations

  • mdfInfo does not return custom file metadata fields.

Version History

Introduced in R2019b

expand all