How to import mf4 file and display in UITable within AppDesigner?

I started out with MatLab and AppDesigner a few weeks ago and as practice for my internship, I created a programm that reads in data via a button press, displays it and makes it interactable. I have now almost finished the this app, however I was importing xlxs files and the norm in our company seems to be mf4 files. I have trouble reading these in and I cannot seem to find the answer anywhere.
xlxs version that works correctly.
function fileUpload(app, event)
[file, path] = uigetfile('*xlsx');
fullpath = fullfile(path, file);
app.Table = readtable(fullpath, 'VariableNamingRule', 'preserve');
....
end
next up I tried converting this to an mf4 variant looking like this:
function fileUpload2(app, event)
[file, path] = uigetfile('*mf4');
fullpath = fullfile(path, file);
app.Table = readtable(fullpath, 'VariableNamingRule', 'preserve', FileType='mf4');
end
I then get following error message:
Error using readtable (line 517)
'.mf4' is not a recognized file extension. Unable to detect file type. To read the file as a specific file type, regardless of file extension, use the
'FileType' name-value pair.
even if I add ..., FileType='mf4'); it's not working giving me another error message:
Error using readtable (line 517)
Expected 'FileType' to match one of these values:
'text', 'spreadsheet', 'delimitedtext', 'fixedwidth', 'xml', 'html', 'worddocument', 'auto'
The input, 'mf4', did not match any of the valid values.
None of the suggested values work for mf4... Does this mean it is not possible to do what I'm trying to do? Is there an alternative?
Thanks in advance.

 Accepted Answer

Torsten
Torsten on 10 Aug 2026 at 13:11
Moved: Torsten on 10 Aug 2026 at 13:12
Answer from AI:
To read .mf4 (Measurement Data Format version 4) files in MATLAB, use the built-in mdfRead function. This function requires the Vehicle Network Toolbox or the Powertrain Blockset, and it returns the data organized in handy MATLAB timetables. [1, 2, 3]
Reading Options
  • Read the whole file:data = mdfRead("VehicleData.mf4");
  • Read specific channels:data = mdfRead("VehicleData.mf4", Channel=["EngineRPM", "VehicleSpeed"]);
  • Read a specific time range:data = mdfRead("VehicleData.mf4", TimeRange=seconds([0, 30]));
  • Read raw values (no conversion rules applied):data = mdfRead("VehicleData.mf4", ReadRaw=true);
Alternative (No Toolbox License)
If you do not have the required MathWorks toolboxes, you can install the asammdf or mdfreader Python library and call it directly from MATLAB using the py. prefix. [1]

More Answers (0)

Categories

Find more on Application Deployment in Help Center and File Exchange

Products

Release

R2024b

Asked:

on 10 Aug 2026 at 12:33

Moved:

on 10 Aug 2026 at 13:12

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!