Converting .bin to MATLAB format

Hello everyone,

I’ve been trying to covert the following .bin file to MATLAB format for analysis
1 31-12-1969 19-00-00.bin (488 KB)

And I tried to do so using the following menu in mission planner :
image

However, when I tried to open the resulting file in MATLAB I got the following error :

Error using load
Unable to read file ‘C:\Users\bagas\Documents\Mission Planner\logs\QUADROTOR\1\1 31-12-1969
19-00-00.bin-12706.mat’. Input must be a MAT-file or an ASCII file containing numeric data
with same number of columns in each row.

Error in uiimport/runImportdata (line 505)
datastruct = load(‘-ascii’, fileAbsolutePath);

Error in uiimport/gatherFilePreviewData (line 473)
[datastruct, textDelimiter, headerLines]= runImportdata(fileAbsolutePath, type);

Error in uiimport (line 297)
gatherFilePreviewData(fileAbsolutePath);

Has anyone ever run into similar problem before or know how to fix this?

Thank you very much

I would use the Pymavlink tool

python pymavlink\tools\mavlogdump.py "input log name" --planner --format mat --mat_file "output log name"

You will get a nice structure in a .mat file.

2 Likes

will do, thank you very much!

Hi. I am trying the mavlogdump.py script from the latest pymavlink repository but am getting the following error message. I have tried changing the encoding to latin-1 instead of utf-8 but that doesn’t help. I am using Python 2.7 and pymavlink 2.4.16. This log loads fine in Mission Planner as is.

My command was

python mavlogdump.py testlog.BIN --planner --format mat --mat_file "test_log"

Thanks!

for me this works fine with the mission planner created version
load(“C:\Users\mich1\Downloads\00000051.BIN-3666197.mat”)
Tested on R2022a