MDF Files
The toolbox provides read and write access to MDF files. You can sort and finalize MDF files, and add, save, or remove attachments.
Use mdfDatastore
to access a datastore comprised of large or
multiple MDF files.
Functions
MDF File
Reading
mdfInfo | Access or create MDF file metadata |
mdfChannelGroupInfo | Get channel group metadata from MDF file (Since R2023a) |
mdfChannelInfo | Get channel metadata from MDF file (Since R2023a) |
mdfRead | Read channel data from MDF file (Since R2023a) |
mdfVisualize | View channel data from MDF file |
Writing
mdfCreate | Create MDF file with metadata (Since R2022a) |
mdfWrite | Write timetable data to MDF file (Since R2022a) |
mdfAddChannelGroupMetadata | Add channel group and channel metadata to timetable (Since R2022a) |
File Operations
mdfSort | Sort MDF file by ASAM standards |
mdfFinalize | Finalize MDF file by ASAM standards (Since R2021b) |
mdfSaveAttachment | Save embedded attachment files from MDF file (Since R2023a) |
mdfAddAttachment | Attach file to MDF file (Since R2022a) |
mdfRemoveAttachment | Remove attachment from MDF file (Since R2022a) |
MDF Datastore
mdfDatastore | Datastore for collection of MDF files |
read | Read data in MDF datastore |
readall | Read all data in MDF datastore |
preview | Subset of data from MDF datastore |
reset | Reset MDF datastore to initial state |
hasdata | Determine if data is available to read from MDF datastore |
partition | Partition MDF datastore |
numpartitions | Number of partitions for MDF datastore |
Topics
- Transition Your mdf Object Code
Update your code to directly access MDF files, instead of using
mdf
objects. - Troubleshooting MDF Applications
Troubleshoot common issues with MDF file applications.
Related Information
Featured Examples
Read Physical and Raw Data from MDF Files
Read channel data from an MDF file as physical values and raw values.
Work with Unfinalized and Unsorted MDF Files
Work with unfinalized and unsorted MDF files. The unfinalized MDF file used in this example, MDFUnfinalized.MF4, was recorded by a CANedge2 CAN bus data logger from CSS Electronics.
Get Started with Writing Timetable Data to MDF Files
Write timetable data into an MDF file. The MAT-file used in this example MDFTimetables.mat contains two timetables.
Customize Metadata When Writing Timetable Data to MDF Files
Customize the file, channel group, and channel metadata when writing timetable data to an MDF file.
Overwrite Channel Group Data in an MDF File
Process data logged in a channel group of an MDF file and write the updated data back to the same channel group. The MDF file used in this example VehicleData.mf4 contains data logged from two simulations in two channel groups, but the example only works with data in channel group 1.
Write Channel Group Data from an Existing MDF File to a New MDF File
Process data logged in a channel group of an MDF file and write the updated data to a new file. The MDF file used in this example VehicleData.mf4 contains data logged from two simulations in two channel groups, but the example only works with data in channel group 2.
Work with MDF Attachment Files
Add attachment files to an MDF file, remove attachment files from an MDF file, and save attachment files embedded in an MDF file to disk. The MDF file used in this example VehicleData.mf4 currently has one embedded attachment named ReadMe.txt.
Decode and Write CAN Data in MDF Files
Import and decode CAN data from an MDF file in MATLAB® for analysis, and write the decoded data back to the same file.
Decode J1939 Data from MDF Files
Import and decode J1939 data from MDF files in MATLAB® for analysis. The MDF file used in this example was generated from Vector CANoe using the "System Configuration (J1939)" sample. This example also uses the CAN database file, Powertrain_J1939_MDF.dbc, provided with the Vector sample configuration.
Get Started with MDF Datastore
Use the MDF datastore feature of Vehicle Network Toolbox™ to quickly and efficiently process a data set spread across a collection of multiple MDF files. This workflow is also valuable when there are too much data to fit into available memory.
Analyze Data Using MDF Datastore and Tall Arrays
Work with a big data set using tall arrays and the MDF datastore feature. Tall arrays are commonly used to perform calculations on different types of data that do not fit in memory.
Data Analytics Application with Many MDF Files
Investigate vehicle battery power during discharge mode across various drive cycles. The data for this analysis are contained in a set of vehicle log files in MDF format. For this example, we need to build up a mechanism that can "detect" when the vehicle battery is in a given mode. What we are really doing is building a detector to determine when a signal of interest (battery power in this case) meets specific criteria. When the criteria is met, we will call that an "event". Each event will be subsequently "qualified" by imposing time bounds. That is to say an event is "qualified" if it persists for at least 5 seconds (such a qualification step can help limit noise and remove transients). The thresholds shown in this example are illustrative only.
Map Channels from MDF Files to Simulink Model Input Ports
Programmatically map channels from MDF files and consume their data via input ports of a Simulink® model. It performs the gathering of input port names of a Simulink model and correlates them to the content of a given MDF file. A linkage between them is then created which consumes channel data sourced from the MDF file when the model runs.
Read Validity Data from MDF Files
Read and use validity data from MDF files for preprocessing.
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)