Binary format that Matlab can read, and how to convert with C/c++?

5 views (last 30 days)
My current procedure is not optimal. It is:
  1. extract terabytes of data with c++.
  2. Naivly writing that to disk in ascii format
  3. analysing this data using Matlab. I am reading in tons of moderately sized files (half a milliion lines of doubles for each file), rather than a few huge files. Hence tall arrays aren't necessary, just a good format.
So my question is:
  1. Instead of writing to disk in ascii format, is there an easy to use c++ library (or matlab library that Matlab coder can convert to C) that converts the data to some binary format that matlab can read?
  2. Or alternatively, can matlab read unformatted Fortran data? Probably this is not 'so' ideal since the data switches machines
Also,
  1. The reason for preferring binary formats to ascii are file size and speed savings. Also, I was reading about HDF5, and it seemed really hard to use, whereas I would prefer something that will not cost me several days to get up and working.
  2. I realize this question would be perhaps better asked on stackexchange on a C forum, but I was afraid I would get responses which Matlab would not be able to work with, hence I am asking this question from the Matlab side.

Answers (0)

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!