Get Started with MDF Files
This example shows you how to access information about an MDF file and its contents.
View File Details
View metadata of an MDF file using mdfInfo
by specifying the file name. This sample file was created from MATLAB® using Vehicle Network Toolbox™.
fileInfo = mdfInfo("VehicleData.mf4")
fileInfo = MDFInfo with properties: File Details Name: "VehicleData.mf4" Path: "/tmp/Bdoc25a_2864802_1971459/tpcbc94420/vnt-ex51113426/VehicleData.mf4" Author: "Engineer" Department: "Automotive" Project: "Demo" Subject: "Prototype" Comment: "Example file" Version: "4.20" InitialTimestamp: 2024-11-14 19:16:35.000000000 Creator Details ProgramIdentifier: "MATLAB" CreatorVendorName: "The MathWorks, Inc." CreatorToolName: "MATLAB" CreatorToolVersion: "25.1.0.2768609 (R2025a) Prerelease" CreatorUserName: "engineer" CreatorComment: "Created with Vehicle Network Toolbox" File Contents Attachment: [1×7 table] ChannelGroupCount: 2 Event: [0×8 eventtable]
Basic details about the MDF file are available as properties under section File Details
.
Information about the originating tool can be found under section Creator Details
.
Details about attachments, channel groups and events are listed under section File Contents
.
View Channel Group Details
Data in an MDF file is organized into channels within channel groups. This sample file contains two channel groups, as indicated by the ChannelGroupCount
property.
fileInfo.ChannelGroupCount
ans = uint64
2
View details about the two channel groups using mdfChannelGroupInfo
.
chanGrpInfo = mdfChannelGroupInfo("VehicleData.mf4")
chanGrpInfo=2×13 table
GroupNumber AcquisitionName Comment NumSamples DataSize Sorted SourceName SourcePath SourceComment SourceType SourceBusType SourceBusChannelNumber SourceSimulated
___________ _______________ ___________________________________________________________________________ __________ ________ ______ ___________ ___________ _____________ ___________ _____________ ______________________ _______________
1 <undefined> Simulation of an automatic transmission controller during passing maneuver. 751 43558 true <undefined> <undefined> <undefined> Unspecified Unspecified 0 false
2 <undefined> Simulation of engine gas dynamics. 92033 2208792 true <undefined> <undefined> <undefined> Unspecified Unspecified 0 false
View Channel Details
Use mdfChannelInfo
to view details about all the channels in this MDF file.
chanInfoDefault = mdfChannelInfo("VehicleData.mf4")
chanInfoDefault=12×13 table
Name GroupNumber GroupNumSamples GroupAcquisitionName GroupComment GroupSourceName GroupSourcePath DisplayName Unit Comment ExtendedNamePrefix SourceName SourcePath
_________________ ___________ _______________ ____________________ ___________________________________________________________________________ _______________ _______________ ___________ ___________ ___________ __________________ ___________ ___________
"AirFlow" 2 92033 <undefined> Simulation of engine gas dynamics. <undefined> <undefined> "" g/s <undefined> <undefined> <undefined> <undefined>
"Brake" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" ft*lbf <undefined> <undefined> <undefined> <undefined>
"EngineRPM" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" rpm <undefined> <undefined> <undefined> <undefined>
"FuelRate" 2 92033 <undefined> Simulation of engine gas dynamics. <undefined> <undefined> "" g/s <undefined> <undefined> <undefined> <undefined>
"Gear" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" <undefined> <undefined> <undefined> <undefined> <undefined>
"ImpellerTorque" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" ft*lbf <undefined> <undefined> <undefined> <undefined>
"OutputTorque" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" ft*lbf <undefined> <undefined> <undefined> <undefined>
"Throttle" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" % <undefined> <undefined> <undefined> <undefined>
"TransmissionRPM" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" rpm <undefined> <undefined> <undefined> <undefined>
"VehicleSpeed" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" mph <undefined> <undefined> <undefined> <undefined>
"time" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" s <undefined> <undefined> <undefined> <undefined>
"time" 2 92033 <undefined> Simulation of engine gas dynamics. <undefined> <undefined> "" s <undefined> <undefined> <undefined> <undefined>
By default, the function returns minimal channel metadata. To view additional metadata, set the AdditionalMetadata
option to true..
chanInfoAdditional = mdfChannelInfo("VehicleData.mf4", AdditionalMetadata=true)
chanInfoAdditional=12×25 table
Name GroupNumber GroupNumSamples GroupAcquisitionName GroupComment GroupSourceName GroupSourcePath DisplayName Unit Comment ExtendedNamePrefix SourceName SourcePath Type SyncType DataType NumBits ComponentType CompositionType ConversionType SourceComment SourceType SourceBusType SourceBusChannelNumber SourceSimulated
_________________ ___________ _______________ ____________________ ___________________________________________________________________________ _______________ _______________ ___________ ___________ ___________ __________________ ___________ ___________ ___________ ________ ___________________________ _______ _____________ _______________ ______________ _____________ ___________ _____________ ______________________ _______________
"AirFlow" 2 92033 <undefined> Simulation of engine gas dynamics. <undefined> <undefined> "" g/s <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"Brake" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" ft*lbf <undefined> <undefined> <undefined> <undefined> FixedLength None IntegerUnsignedLittleEndian 8 None None Unspecified "" Unspecified Unspecified 0 false
"EngineRPM" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" rpm <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"FuelRate" 2 92033 <undefined> Simulation of engine gas dynamics. <undefined> <undefined> "" g/s <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"Gear" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" <undefined> <undefined> <undefined> <undefined> <undefined> FixedLength None IntegerUnsignedLittleEndian 8 None None Unspecified "" Unspecified Unspecified 0 false
"ImpellerTorque" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" ft*lbf <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"OutputTorque" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" ft*lbf <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"Throttle" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" % <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"TransmissionRPM" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" rpm <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"VehicleSpeed" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" mph <undefined> <undefined> <undefined> <undefined> FixedLength None RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"time" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" s <undefined> <undefined> <undefined> <undefined> Master Time RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
"time" 2 92033 <undefined> Simulation of engine gas dynamics. <undefined> <undefined> "" s <undefined> <undefined> <undefined> <undefined> Master Time RealLittleEndian 64 None None Unspecified "" Unspecified Unspecified 0 false
Find Channels in an MDF File
mdfChannelInfo
can also query channel details within an MDF file if the name is fully or partially known. The function provides an option Channel
that supports wildcards for string matching.
To find channels whose name is exactly "Gear":
pwmChanInfoExact = mdfChannelInfo("VehicleData.mf4", Channel="Gear")
pwmChanInfoExact=1×13 table
Name GroupNumber GroupNumSamples GroupAcquisitionName GroupComment GroupSourceName GroupSourcePath DisplayName Unit Comment ExtendedNamePrefix SourceName SourcePath
______ ___________ _______________ ____________________ ___________________________________________________________________________ _______________ _______________ ___________ ___________ ___________ __________________ ___________ ___________
"Gear" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" <undefined> <undefined> <undefined> <undefined> <undefined>
To find channels whose names contain the substring "RPM":
pwmChanInfoWildcards = mdfChannelInfo("VehicleData.mf4", Channel="*RPM*")
pwmChanInfoWildcards=2×13 table
Name GroupNumber GroupNumSamples GroupAcquisitionName GroupComment GroupSourceName GroupSourcePath DisplayName Unit Comment ExtendedNamePrefix SourceName SourcePath
_________________ ___________ _______________ ____________________ ___________________________________________________________________________ _______________ _______________ ___________ ____ ___________ __________________ ___________ ___________
"EngineRPM" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" rpm <undefined> <undefined> <undefined> <undefined>
"TransmissionRPM" 1 751 <undefined> Simulation of an automatic transmission controller during passing maneuver. <undefined> <undefined> "" rpm <undefined> <undefined> <undefined> <undefined>