Replies: 3 comments 1 reply
-
Hey Felix, I looked into your problem: Check MDF File: Ensure that the 'C:/a/test.mf4' file is a valid MDF file and that it contains data. You can open it with the GUI again to confirm. Verbose Output: Add more verbose output to get insights on what's happening during the export process. Export Format Specification: Ensure the format string is correct. The export format should be specified correctly (in this case, 'mat'). This could be a better working code (didnt test tho) : pprint("python=" + sys.version) try: try: input_file = 'C:/a/test.mf4' Check if input file existsif not os.path.exists(input_file): Load the MDF filetry: Export to MAT filetry: Verifies the existence of the input MDF file. I hope this helps in any way, |
Beta Was this translation helpful? Give feedback.
-
Hi Jakub, Thank you for your support. Unfortunatelly I got the same result, no output file was created. Main question: Are the following lines correct to convert an mf4 to matlab? Is the syntax ok?
I got the following output from your script: kind regards, Felix |
Beta Was this translation helpful? Give feedback.
-
Hey, so from what I see there is no issue with your syntax, the only problem I could see is the slashes and backslashes in the path. Im not quite sure how the asammdf lib wants you to input paths, but the convention would be to put backslashes, so rather C:\a\ . |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I tried to convert a mf4 file into Matlab .mat with the GUI, it worked well.
Than I tried to do this in script. But I'm not sure if I use the right code. I have read the documentation, but unfortunatelly that didn't helped me in detail.
My problem is, the following code runs without error but no mat-file is produced? What am I doing wrong? I hope you can help me.
I'm using the following code:
import asammdf
from asammdf import MDF, Signal
import platform
import sys
from pprint import pprint
pprint("python=" + sys.version)
pprint("os=" + platform.platform())
try:
import numpy
pprint("numpy=" + numpy.__version__)
except ImportError:
pass
try:
import asammdf
pprint("asammdf=" + asammdf.__version__)
except ImportError:
pass
mdf = asammdf.MDF('C:/a/test.mf4')
mdf.export('mat', 'C:/a/test.mat')
It produces following output:
C:\a\asammdf> & C:/Users/xyz/AppData/Local/Programs/Python/Python312/python.exe c:/a/conv.py
ldf is not supported
xls is not supported
xlsx is not supported
yaml is not supported
('python=3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 '
'bit (AMD64)]')
'os=Windows-10-10.0.19045-SP0'
'numpy=1.26.4'
'asammdf=7.4.5'
but: no output file will has been created :-(
Beta Was this translation helpful? Give feedback.
All reactions