mdfInfo
Access or create MDF file metadata
Description
returns an fileInfo
= mdfInfo(mdfFileName
)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.
Examples
Access Information About MDF File
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 MDFInfo Object for New File
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
mdfFileName
— MDF file name
string | char vector
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 Example:
| ||||||||
Other folders | To access a file in a folder other than the current folder, specify
the full or relative path name in
Example:
Example:
| ||||||||
Remote locations | To access a file in a remote location,
Based on the remote location,
For more information, see Work with Remote Data. Example:
|
Data Types: char
| string
Output Arguments
fileInfo
— MDF file metadata information
MDFInfo
object
MDF file metadata information, returned as an MDFInfo
object with
the following properties:
MDFInfo
Object Properties
Property Name | Data Type | Access |
---|---|---|
File Details | ||
Name | string | Read-only |
Path | string | Read-only |
Author | string | Read/write |
Department | string | Read/write |
Project | string | Read/write |
Subject | string | Read/write |
Comment | string | Read/write |
Version | string | Read/write |
InitialTimestamp | datetime | Read/write |
Creator Details | ||
ProgramIdentifier | string | Read-only |
CreatorVendorName | string | Read-only |
CreatorToolName | string | Read-only |
CreatorToolVersion | string | Read-only |
CreatorUserName | string | Read/write |
CreatorComment | string | Read/write |
File Contents | ||
Attachment | table | Read-only |
ChannelGroupCount | uint64 | Read-only |
Event | eventtable | Read-only |
Limitations
mdfInfo
does not return custom file metadata fields.
Version History
Introduced in R2019bR2024b: Event Property Added
The output object now includes an Event
property that contains a
table of events read from the MDF file.
R2023a: mdfInfo Outputs an Object
In previous releases, mdfInfo
generated a structure output.
Starting in R2023a, the output is an MDFInfo
object. This update is
consistent with the update to the mdfCreate
function input. Where possible, the properties of this object
reflect the field names of the old structure output, so programmatic access might be
unchanged. However a few changes might impact your workflow:
Some properties of the
MDFInfo
object are read-only.The
MDFInfo.Attachment
property is now a table. You can access the first row of the table asMDFInfo.Attachment(1,:)
.
R2023a: Support for Remote File URLs
You can directly access MDF file data stored at remote locations, including Amazon S3, Azure® Blob Storage, and HDFS.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)